Assign Custom Property to a Variable

Mar 17, 2006 3 Replies

I want a custom property "Area" to be assigned to "SW-SurfaceArea" with a macro (or automatically to large number of existing files). For new files, I've added property to template.



The manual way to do this is go to Custom Properties Property Name: Area Type: Text Value: " snipped-for-privacy@Part1.sldprt" (select from scrolldown)



How do I add Property and value(referencing file) with a macro?



I use the following line and get SW-SurfaceArea for Value. I need "SW-SurfaceArea" to be evaluated. How do I get the quotes?



retval = Part.AddCustomInfo3("", "AREA", swCustomInfoText,"SW-SurfaceArea")



Thanks, Blair



BTW: I'd prefer a dynamic link, so I haven't used GetMassProperties



How about a batch update program? I've tried Propagater in the past with great success! It's at

formatting link
and has a free trial "light version" and the full blown package is $50 (well worth the price vs. programming something yourself).

Keith

Thanks Keith and Steve for the responses.

Keith, Propagator does add "smart" mass properties which was what I wanted.

Steve, Thanks for sharing your Macros. Batch-Add-Macros add the smart properties that I want. It also allowed me to peek inside and see that I had to put together a string with " in the form of ch(34) to keep the quotes necessary.

Thanks for the useful help.

Sincerely, Blair

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required