2 Replies Latest reply on Oct 21, 2015 10:32 AM by Deepak Gupta

    VBA API - Change .prtprp template used on part

    Tristen Gitzel

      Is there a way to update a part to use a different template for the property tab builder? 


      Eg. Macro opens the "Template Options" Dialog box, then selects a new filename, clicks ok, then pushes "Apply"?


      I have a bunch of parts created using an older template, and would like to run the macro to convert over to the new one.

        • Re: VBA API - Change .prtprp template used on part
          Adam Hoffman

          As far as I know this is not possible yet. It has come up in discussion many times before, and there currently is not a way of switching the template in a quick easy way like you are wanting. The only way of doing it through code that I know of would be to:

          1. Open your model
          2. Get the custom property manager object
          3. Store all the custom property values into an array
          4. Delete all the custom properties one by one
          5. Add the new custom properties that match the new template you are wanting to use
          6. Fill in those properties with information obtained from the previous values
          7. Force Rebuild, save, close, and repeat

          If you go to the API help and look at the CustomPropertyManager methods you will find the tools you need. Hope this helps.

          • Re: VBA API - Change .prtprp template used on part
            Deepak Gupta

            Sorry but this is a current limitation. You may want to vote for SPR #: 542212