API Body2.MaterialPropertyValues2 can't unset
API Body2.MaterialPropertyValues2 can't unset
(OP)
I am writing a program to scrub-out all face- and body-specific colors. Faces seem to go OK, but boides are a no-go.
I've tried everything I can think of.
If a body's color has never been set, Body2.MaterialPropertyValues2 returns "Empty". This means the body uses the part file's properties. Once this has been set, there is no way to set it back to empty via API. (same effect as "Remove color" by menu picks).
Body2.MaterialPropertyValues2=Empty 'does not do the trick
TIA
Tick
I've tried everything I can think of.
If a body's color has never been set, Body2.MaterialPropertyValues2 returns "Empty". This means the body uses the part file's properties. Once this has been set, there is no way to set it back to empty via API. (same effect as "Remove color" by menu picks).
Body2.MaterialPropertyValues2=Empty 'does not do the trick
TIA
Tick
"Great ideas need landing gear as well as wings."--C. D. Jackson 
http://www.EsoxRepublic.com






RE: API Body2.MaterialPropertyValues2 can't unset
What do you mean by "Body2.MaterialPropertyValues2=Empty"?
Do you write the word Empty?
Regards
RE: API Body2.MaterialPropertyValues2 can't unset
I've tried many things: Empty Keyword, a variant set to Empty, various other null values. Nothing returns the body material to "same as part material".
RE: API Body2.MaterialPropertyValues2 can't unset
I don't know if you can set an array empty without a proper command (that is, by assigning an "empty value" to the variable).
Try:
retval = Component2.RemoveMaterialProperty2 ( config_opt, config_names)
Good Luck
RE: API Body2.MaterialPropertyValues2 can't unset
I've been assigning various values such as Empty, Nothing, Null, etc. to a variant "retVar" and then calling swBody.MaterialPropertyValues2 = retVar
Also tried swBody.MaterialPropertyValues2 = (retVar)
How would one use Component2.RemoveMaterialProperty2 in a .SLDPRT?
RE: API Body2.MaterialPropertyValues2 can't unset
I was - and he did. So at least I didn't get coal.....
OK, OK, It's a reference to my holiday sig. "Be naughty - Save Santa a trip..."
RE: API Body2.MaterialPropertyValues2 can't unset