3 Replies Latest reply on Jul 6, 2016 2:10 PM by Keith Rice

    Adding partnumber and bendlines to Export Flat Pattern View (Configurations)

    Tom Adams

      I am interested in this macro 3D ContentCentral and I am attempting to modify it to do 2 additional things:

       

      1) Use the partnumber added in the Configuration Properties under Bill of material options (part number displayed when used in a bill of materials) instead of the configuration name.

       

      For example:

      Part name is MWS, current config is 2418-WM, so current name looks like:

      MWS.MWS-2418-WM.DXF

       

      What I am trying to achieve is

      99999980.DXF

       

      2) I would like to add the abilities of options as found in another macro Export_DXF that would allow me to export the flat pattern with bendlines etc.etc.

       

      In my first attempts I added in some lines from this example: http://help.solidworks.com/2012/English/api/sldworksapi/Get_List_Of_Configurations_Example_VB.htm

      Debug.Print "  ConfigName(" + Str(i) + ") = " + sConfigName

        Debug.Print "    UseAlternateNameInBOM = " + Str(swConfig.UseAlternateNameInBOM)

        Debug.Print "    AlternateName         = " + swConfig.alternateName

        Debug.Print "    Comment               = " + swConfig.comment

        Debug.Print ""

       

      With no success. I am able to copy and paste and track down some data flow through a macro. but I find myself getting stuck on what I feel are simple things. I would greatly appreciate some help with this macro and some advice, would taking a SW macro course be a good idea with no VB background?

       

      Thank you for your time,

      Tom Adams

        • Re: Adding partnumber and bendlines to Export Flat Pattern View (Configurations)
          Artem Taturevych

          Hi Tom,

           

          Take a look at this example: #CODE|Get Configuration Part Number . Are you planning to export this for a single document or do you want to have a batch export of, for example, all files in the folder?

           

          would taking a SW macro course be a good idea with no VB background?

          I would not recommend to do this. But you can learn it yourself and read some VBA books or take some online tutorials/YouTube videos to understand the concepts. You do not need to have a deep knowledge of programming/VBA to attend API Fundamentals course, but understanding of basics would definitely help.

           

          I would recommend API Tutorials by Keith Rice at http://cadsharp.com/. I believe there also some VBA tutorials as well.

           

          Thanks,
          Artem

            • Re: Adding partnumber and bendlines to Export Flat Pattern View (Configurations)
              Tom Adams

              Take a look at this example: #CODE|Get Configuration Part Number . Are you planning to export this for a single document or do you want to have a batch export of, for example, all files in the folder?

              That is an excellent example, I will see if I can incorporate that into the code I have presently. What I have is a single file with configurations. Within those configurations I have used the part number option as indicated above to assign part numbers to each of the configurations. Then with some luck I plan on exporting the flat patterns out as [partnumber].dxf  into folders that have the first 3 numbers of the partnumber (semi smart partnumbering scheme)

               

              For example:

              MWS.SLDPRT

              Has several configurations which I assign the partnumbers 7000101, 7000102, 7000103...

               

              The folders would be something like

              [Drive letter]/staticpathtoexportfilesto/

              (and the folder structure)

              ...

              6000000

              6100000

              6110000

              ...

              7000000

              7000101.DXF

              7000101.PDF

              7100000

              7110000

              ...

              To answer your question, currently I am just looking to get a single .SLDPRT. I think in the future a per folder batch would be extremely useful as would performing it on an assembly. However I digress, as I must first get the basics setup.

               

              I would not recommend to do this. But you can learn it yourself and read some VBA books or take some online tutorials/YouTube videos to understand the concepts. You do not need to have a deep knowledge of programming/VBA to attend API Fundamentals course, but understanding of basics would definitely help.

               

              I would recommend API Tutorials by Keith Rice at http://cadsharp.com/. I believe there also some VBA tutorials as well.

              Thank you for your insight, I appreciate it. I will have a look at links you provided - I have them bookmarked! Again, I appreciate your help and time in this matter. Thank you!

               

              Tom