3 Replies Latest reply on Jun 1, 2015 3:34 AM by Solidworks Selim

    dxf export sheet metal assemblies

    Solidworks Selim

      Part1-10MM-QYT4-ST-37

      Part2-10MM-QYT1-ST-37

      dxf export macro sheet assemblies

       

       

      100.JPG

        • Re: dxf export sheet metal assemblies
          Solidworks Selim

          Does not anybody know?

          is anyone there?

          replied

            • Re: dxf export sheet metal assemblies
              Koen De Langhe

              Hello,

              We solved the problem like this:

              1. Open a drawing
              2. Create a view.
              3. Read the bodies
              4. Set the body to view
              5. Save to DXF.

               

               

               

              .....

              Set myView = Part.CreateDrawViewFromModelView3(PartPath, "*Front", 0, 0, 0)

              Set Part = myView.ReferencedDocument

              Dim Bodies(0) As Object

              nbrBodies = myView.GetBodiesCount

              arrbody = Part.GetBodies2(swSolidBody, True)

              swApp.ActivateDoc2 mysheet, False, longstatus

              Set Part = swApp.ActiveDoc

              i = 0

              For Each ding In arrbody

                  test = ding.name

                  If test = "Base-Flange1" Then

                      If (nbrBodies = 1) Then

                       myView.Bodies = (arrbody)

                      Else

                 ' Set the body to view

                          Set Bodies(0) = arrbody(i)

                          arrBodiesIn = Bodies

                          myView.Bodies = arrBodiesIn

                      End If

                      longstatus = Part.SaveAs3(SavePath & Flange1 & ".DXF", 0, 0)

                      If Strings.Left(Flange1, 2) = "PA" Then

                       Flange1 = "GL" + Strings.Right(Flange1, Len(Flange1) - 2)

                       longstatus = Part.SaveAs3(SavePath & Flange1 & ".DXF", 0, 0)

                      End If

                  End If

                  If test = "Base-Flange2" Then

                      If (nbrBodies = 1) Then

                       myView.Bodies = (arrbody)

                      Else

                 ' Set the body to view

                          Set Bodies(0) = arrbody(i)

                          arrBodiesIn = Bodies

                          myView.Bodies = arrBodiesIn

                      End If

                      longstatus = Part.SaveAs3(SavePath & Flange2 & ".DXF", 0, 0)

                      If Strings.Left(Flange2, 2) = "PA" Then

                       Flange2 = "GL" + Strings.Right(Flange2, Len(Flange2) - 2)

                       longstatus = Part.SaveAs3(SavePath & Flange2 & ".DXF", 0, 0)

                      End If

                  End If

                  If test = "Base-Flange3" Then

                      If (nbrBodies = 1) Then

                       myView.Bodies = (arrbody)

                      Else

                 ' Set the body to view

                          Set Bodies(0) = arrbody(i)

                          arrBodiesIn = Bodies

                          myView.Bodies = arrBodiesIn

                      End If

                      longstatus = Part.SaveAs3(SavePath & Flange3 & ".DXF", 0, 0)

                      If Strings.Left(Flange3, 2) = "PA" Then

                       Flange3 = "GL" + Strings.Right(Flange3, Len(Flange3) - 2)

                       longstatus = Part.SaveAs3(SavePath & Flange3 & ".DXF", 0, 0)

                      End If

                  End If

                  i = i + 1

              Next ding

               

              .....