Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

API Body2.MaterialPropertyValues2 can't unset

Status
Not open for further replies.

TheTick

Mechanical
Mar 5, 2003
10,194
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

[bat]"Great ideas need landing gear as well as wings."--C. D. Jackson [bat]
 
Replies continue below

Recommended for you

TheTick

What do you mean by "Body2.MaterialPropertyValues2=Empty"?

Do you write the word Empty?

Regards
 
That's one of the ways I tried in my VB program (though substituting "Body2[" with the object variable name).

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".
 
Have you tried "" (empty string)?

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

 
I'll try the empty string.

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?
 
Not so much a programming issue, but remember there is some interesting interdependency logic between face and body color in SW. Sometimes you think you got everything only to find someone else tweaked a face.

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..."
 
The removal of face colors is working fine. The program traverses all faces of each body and removes color, then works on the bodies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor