9 Replies Latest reply on May 28, 2017 8:47 AM by Bernie Daraz

    Importing DXF points

    Jim Glomb

      I measure building exteriors with a total station that exports a DXF file. If I import the DXF file the text labels for the data points show up fine, but the actual points do not. What is it about the points that allows them to appear in AutoCAD but not in Solidworks?

        • Re: Importing DXF points
          Doug Seibel

          If you can live with all the points coming in on one flat plane, then import it using the options shown below.

            • Re: Importing DXF points
              Jim Glomb

              Thanks, but I've tried that.

               

              With all the points on one plane I can't build a 3D model from the points. I need the points in their exact locations in 3D space.

                • Re: Importing DXF points
                  Chris Dordoni

                  Jim,

                   

                  Can your Total Station save as a XYZ, ASC, or similar point format?  There is a macro that will import points as an XYZ file, its just a list of 3D coordinates.

                   

                  I thought I had imported 3D points from a DXF/DWG previously. Now I cannot find or create a DXF/DWG file that imports as 3D points. Perhaps there is a way, but it seems that ACAD standard point entity gets projected to a 2D plane.

              • Re: Importing DXF points
                Michael Lord

                Jim,

                 

                I don't have any experience in what you are doing but not all dxf are the same.

                You may need to save the dxf as a different version/ format for SOLIDWORKS to recognize.  (R2010 etc) 

                  • Re: Importing DXF points
                    Bernie Daraz

                    True. I did a bunch of programming that generated DXF files about 20 years ago. There is a ton of information before the 'usable' part of the DXF file starts. I did not require Z. All of my program generated DXF files started without the header information as shown below:

                     

                    0

                    SECTION

                    2

                    ENTITIES

                    0

                    LINE

                  • Re: Importing DXF points
                    Chris Dordoni

                    Rob Edwards  describes a way to get points into SolidWorks as a 3D sketch, preserving the 3d coordinates in this thread Creating a feature circular pattern with spheres.

                     

                    The DXF points could be converted to a XYZ format, if its not possible to get a point cloud instead of DXF. However, Meshlab mentioned in the thread above can't read a DXF.

                     

                    CloudCompare can generate an XYZ from a DXF; however, it also throws in extra columns for default rgb values of each point, which might have to be stripped out for the macro to run. Its possible the macro will just ignore the extra columns. I will have to test that when I have a chance.

                    • Re: Importing DXF points
                      Bernie Daraz

                      As I remember the DXF file structure there are points for 3D, 10 is X start position (if we're talking about a line), 20 is Y and 30 is Z. I have seen DXF files without the Z referred to at all. (11 X end position, 21 Y, 31 Z). Can you open the DXF file and look to see if it has all of them, it may not have Z coordinates. It is just a text file, there may be a ton of header information in the beginning so you will have to scroll until you see a LINE, CIRCLE or ARC statement. There are other ones like 40 is the radius value for a circle or arc. I have never seen a point referred to in DXF, not that it isn't there. But a point may be difficult to see in SW. Did you do a window select while editing the sketch to see if they showed up?

                       

                      Was curious so I took a look at the ACAD reference:

                      Group codes

                      Description

                      100

                      Subclass marker (AcDbPoint)

                      10

                      Point location (in WCS)
                      DXF: X value; APP: 3D point

                      20, 30

                      DXF: Y and Z values of point location (in WCS)

                      39

                      Thickness (optional; default = 0)

                      210

                      Extrusion direction (optional; default = 0, 0, 1)
                      DXF: X value; APP: 3D vector

                      220, 230

                      DXF: Y and Z values of extrusion direction (optional)

                      50

                      Angle of the X axis for the UCS in effect when the point was drawn (optional, default = 0); used when PDMODE is nonzero

                        • Re: Importing DXF points
                          Chris Dordoni

                          In the test DXF that I made, the points are clear when imported into SolidWorks, they are all on a plane despite having 3d coordinates. They are on a plane even when choosing the "3D curves or model". My "points test r12.dxf" has three points. The points are listed at the end of the file as shown below. The file is attached.

                          ENDSEC

                            0

                          SECTION

                            2

                          ENTITIES

                            0

                          POINT

                            5

                          21B

                            8

                          0

                          10

                          0.193522

                          20

                          0.185991

                          30

                          0.026726

                            0

                          POINT

                            5

                          21C

                            8

                          0

                          10

                          0.118911

                          20

                          0.048247

                          30

                          0.091906

                            0

                          POINT

                            5

                          21D

                            8

                          0

                          10

                          -0.021703

                          20

                          -0.126803

                          30

                          -0.074085

                            0

                          ENDSEC

                            0

                          EOF