Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Solid Bodies in ilogic

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
eveylynne
2534 Views, 2 Replies

Solid Bodies in ilogic

I'm driving the colors of solid bodies in a part with ilogic.  I can select each feature, but this is tedious and combersome.  If I change the part, I have to adjust the rule containing tha list of features affected.  I would rather have the rule look at the solid bodies of the part.  I don't know how to call out a solid body in ilogic.

A feature is, "Feature.Color("featurename"), and a component is "Component.Color("part").  This naming scheme doesn't seem to work with bodies though.

 

What language do I use to modify a body in ilogic?

 

 

IV 2014, Windows 7

2 REPLIES 2
Message 2 of 3
mrattray
in reply to: eveylynne

I can't seem to find anyway to access solids outside the context of derived parts via the API at all. You might try the Inventor Customization forum.

Mike (not Matt) Rattray

Message 3 of 3
xiaodong_liang
in reply to: eveylynne

Hi,

 

you just need to use Inventor API within ilogic. The following is a code demo. For more guide about Inventor API in iLogic, please refer to this course:

http://au.autodesk.com/au-online/classes-on-demand/class-catalog/2011/autocad-inventor-suites/autode...

 

doc = ThisDoc.Document 
oDef = doc.ComponentDefinition

'assume there are two appearances in the documents 
oGold_Color = doc.Assets("Gold - Metal") 
oStones_Color = doc.Assets("Small Uneven Rectanguler Stones - Brown")

'if change all bodies with same color 

' in some cases, we need to declare the variable explictly 
Dim oSB As SurfaceBody
For Each oSB In oDef.SurfaceBodies
    oSB.Appearance = oGold_Color
Next

' if change specific body to specific color 
Dim oSB1 As SurfaceBody
oSB1 = oDef.SurfaceBodies(1)
oSB1.Appearance = oGold_Color 

Dim oSB2 As SurfaceBody
oSB2 = oDef.SurfaceBodies(2)
oSB2.Appearance = oStones_Color
 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report