Setting Configuration Specific Properties while a Custom Property Tab is loaded

My macro sets a configuration specific property value.

The macro works fine if I unload my Custom Property Tab

Macro does not work if the Custom Property Tab is loaded.  No error, just that the values won't update.  Seems like the tab causes the values to become read only.

If the property I am changing is not included in the tab, the macro updates the property correctly.

Exerpt from code:

result = swDoc.Extension.CustomPropertyManager(sConfigName).Set("PartType", "Buy")

SW 2010SP5

I want the macro to work when the tab is loaded.  Any ideas?  Thanks!

SolidworksApi macros
Answers 1
TR
TR 2011-08-30 Best Answer

Aha.. found a hint here:

https://forum.solidworks.com/message/154066#154066

Turns out if you look at the CP dialog first, it reloads all the info from the CP tab (blanks any changes by the macro).

Need to rebuild after setting all the properties with the macro, then they stick!