6 Replies Latest reply on Apr 22, 2017 9:40 AM by Peter Brinkhuis

    DXF Export

    Russ Radford

      Hi There.

       

      I am reasonably new  to Solidworks and love the top down design approach. I am a cabinet maker and make a lot of one off designs and also things like kitchens and laundry's. I use a CNC Router to cut all my parts out and currently select each part and save the DXF of the face that I will be cutting out.

      I see lots of macros to export dxf's of sheet metal parts but is there a way to do this with none sheet metal parts?

       

      What I was thinking was a macro to select a face with a given appearance then save a dxf of that face. Is this possible?

      I guess the macro would have to work its way down the parts tree and select them one at a time.

       

      Any help on this would be great.

      Thanks 

        • Re: DXF Export
          Peter Brinkhuis

          I think that would be doable. Would you then apply different wood appearances to surfaces?

           

          I propose something like this:

          1. Traverse feature tree (for parts or assemblies?)
          2. Traverse (flat) surfaces for each part. I don't know how to do this actually, I couldn't find an API call for this.
          3. Change view orientation to normal to that surface
          4. Save view as DXF
          • Re: DXF Export
            Deepak Gupta

            You can create a predefined view in those model with view normal to the face you want to extract. And then can extract that view/face via API.

            • Re: DXF Export
              Timothy Taby

              I use a blank drawing format and place the 2D views I need and then export it as a DXF.  This gives me the 2D patterns I need for our CNC routers.

              • Re: DXF Export
                Russ Radford

                I currently select each face and export to dxf but if you have 30+ face's to export it take way to long so was hoping to automate this to speed things up. Pathfinder 3d looks like it will do what Im after but was kinda hoping for a cheaper option. 

                • Re: DXF Export
                  Amen Allah Jlili

                  Yes. It's possible, here's how you do it:

                   

                   

                  Get the IPartDoc object.
                  Next get all the bodies of the part get IPartDoc::GetBodies().
                  Next you want to traverse all bodies doing the following:
                  With each body you traverse, get all faces using Body2::GetFaces()
                  Now you want to traverse all faces you got from the body
                  With each face you traverse, you want to check if the face is planar. (Get the ISurface object using GetSurface() and use the method IsPlane() to see if the surface is planar).
                  If the surface is planar, you select the face2 with a false append and then run the command normal to.
                  Now you can use save that face2 as dxf with the method IPartDoc::SaveAsDXF2.


                  Cheers!

                  Amen
                  CADHero.com