Based on those ouput formats, I'm guessing that you don't just want to export the point cloud data (XYZ vertices), but want to first fit a surface to the points. Some of the formats you listed don't support a file consisting of only vertices, but require some concept of surface triangles.
If so, your problem includes not just file-export, but also a mesh-triangulation step.
If you'd like to do this step interactively, you could try using MeshLab. This open-source tool provides basic tools for manipulating point clouds and surfaces, and allows export to STL and DXF formats. A brief tutorial for creating a surface from point cloud data is shown here or here. More sophisticated tools exist for converting and manipulating mesh data, but these are generally proprietary and cost a significant amount of money.
If you want to do this programmatically, I suggest you use PCL. Here is a tutorial for creating meshes from point cloud data in PCL. You may have to write a custom function to import your file data into a PointCloud object, but PCL supports export to STL. If you decide to go this route, you may get better help by asking the PCL Mailing List directly.
Can you post more details about the current point-cloud format? "Txt format" is not very descriptive. Perhaps mention what program generated the data, or post a sample of the data file.
@Jeremy The data was obtained by using tally surf in profilometer, used for 3d scanning of objects. It generated x,y,z coordinates which can be saved in .txt format.Finally what we need to do is to generate a 3d model from these coordinates.
There are a couple of options that will work for you. You can create a TIN from the LIDAR xyz points but the resulting DXF will be enormous and probably so large that AutoCAD will become unusable. The other option is to create a quadrilateral mesh from the points. I have written apps to do both.
Check out the results here: https://www.youtube.com/channel/UCpKR...
I've added several more tools for dealing with LAS/LAZ files. The first tool will convert a LAS/LAZ point cloud into a DXF point cloud and preserves the LIDAR point classifications by layer. The other tool will generate a contour map from LIDAR data. See: link text