Assign Custom Property to a Variable

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
Reply to
Blair Sutton
Loading thread data ...
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
Reply to
Keith Streich
You can try my macro if you like:
formatting link
Reply to
Fye
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
Reply to
Blair Sutton

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.