5 Replies Latest reply on Oct 25, 2017 5:55 PM by Nilesh Patel

    Macro To Import Equations

    Patrick Williams

      Hi All

       

      I'm looking to see if there is a macro out there or that can be created to import a linked text file into the equation folder, with the end goal to have this done over multiple parts.

       

      Thanks,

          • Re: Macro To Import Equations
            Patrick Williams

            Hi Nilesh

             

            Thanks for that, having a play around this kind of does what I need.Is there any way this can be done but without the pack and go process. Fairly new to Macros/API so any help would be most appreciate.

              • Re: Macro To Import Equations
                Nilesh Patel

                Hi Patrick,

                 

                Sorry, I should have been more specific. I don't think so you can import the equations directly from an external text file. You will need to have equations in the part document exist to be linked to an external text file. You also mentioned that you need to do this for multiple parts. Will all parts have same equations or will they be different? If they are same across all parts then you can read the data from text file and create equations first and then link them to the same text file. You will find plenty of example online to read data from text file. But you are new to API which will make it more difficult.

                 

                Let me know if more help is needed.

                 

                Regards.

                  • Re: Macro To Import Equations
                    Patrick Williams

                    Hi Nilesh,

                     

                    Thanks again for getting back, likewise maybe I should have specified, what you are describing is what we are currently doing having one text file that is linked to multiple parts with the same equations in each part. The issue we have is that if you want to add a new value to the text file (for example: "Drawer_Depth" = 20) you have go into every part and re-import the file. So I am wondering if there is a macro out there or that can be created that could automatically do this, opening every part in an assembly and importing the text file.

                     

                    Thanks,

                      • Re: Macro To Import Equations
                        Nilesh Patel

                        Hi Patrick,

                         

                        You will probably have to read the data from the text file and check whether the equation exist or not in each part and if not add the equation to part and link it to external text file using VBA. I don't think there is a macro exists that does this. You will find plenty of examples of adding equations using macro on this form website and modify to suit your requirements.

                         

                        I am not sure of any other method.

                         

                        Good luck!

                         

                        Let me know if you stuck.

                         

                        Regards.