4 Replies Latest reply on Sep 19, 2017 5:51 PM by David Matula

    Copy Custom properties to all configurations

    Steven Dod

      I searched around the forum to find a macro that will copy the Custom properties to all the configurations in a part or assembly.  I did not find one specifically but found enough bits and pieces that I was able to put one together.  I have attached the macro just in case someone else has the same requirements.

       

      Steve

        • Re: Copy Custom properties to all configurations
          David Matula

          Steven,

                      why not just put the properties under the custom tab. At least in the older versions I know that would keep the same settings for any configuration that I would put in the drawing...if I needed something different in one or the other configurations then I would use the config specific property.

          • Re: Copy Custom properties to all configurations
            Amen Allah Jlili

            Hm. While this seem to copy the general custom properties to all the the specific configurations, it does seem to delete all custom properties from all the configurations. If I had a and b custom properties in the "default" configuration and I had a as general custom property too, the outcome of the macro execution will tbe that b will be deleted from the "default" configuration.

             

            Also Dim swModel As ModelDoc2   needs to be Dim swModel As SldWorks.ModelDoc2.

             

            Overall, this looks nice Steven Dod ! Thanks for sharing! if you're serious about custom properties take a look at this.

            • Re: Copy Custom properties to all configurations
              Steven Dod

              David:     We are implementing an ECN package that reads the properties from the configuration used in an assembly.  Prior to this software we only used the Custom properties and life was good.  Now we have to have the "correct/same" properties in all configurations filled out, no empty values.

               

              Amen:     Thanks for the info.  The ModelDoc2 line came from another macro I found but I will fix and make note for future.  As for the delete all I thought all the properties needed to be deleted first before copying over.  I have never gotten the set property to overwrite an existing without deleting it then creating it again with the new value.  I am not a very skilled macro writer but it seems to do the job I need of duplicating the Custom properties throughout.

               

              Steve