Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select Set Problem

4 REPLIES 4
Reply
Message 1 of 5
matt_jlt
319 Views, 4 Replies

Select Set Problem

I have a select set that contains only faces. What i can't work out is how to access the properties all of the faces in the select set as i need to set the render style of them all.

Any on have any ideas?

Thanks, Matt
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: matt_jlt


There are examples in the help, but here is the
general approach. Place the following code in a module in the part document
project.Select a few faces on a part and run the macro.

 

Public Sub OverrideFaceStyle()

 

    Dim ss As
SelectSet
   
    Set ss =
ThisDocument.SelectSet
   
    Dim newStyle
As RenderStyle
    Set newStyle =
ThisDocument.RenderStyles.Item("Blue")
   

    Dim oFace As Face
    For Each oFace In
ss
        Call
oFace.SetRenderStyle(kOverrideRenderStyle, newStyle)
   
Next
   
End Sub

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
have a select set that contains only faces. What i can't work out is how to
access the properties all of the faces in the select set as i need to set the
render style of them all. Any on have any ideas? Thanks,
Matt
Message 3 of 5
matt_jlt
in reply to: matt_jlt

Sorry mate i should have made it a bit clearer, What i am trying to do is to apply the render style to all of the faces at once. The method you suggested is what i currently use but it applies the render style to every face one at a time. Because the files i am using have thousands of faces this takes up a lot of time to do it this way. So if anyone has any ideas it is much appreciated as ive hit a brick wall on this one. Cheers
Message 4 of 5
Anonymous
in reply to: matt_jlt


As far as I know, you'll have to change them
individually. If you are doing this in an add-in you would probably see a
performance increase (and get other benefits) by using a change-processor.

 

Is this in the context of an assembly or imported
geometry in a faceted format? If an assembly, could you just change the
renderstyle of complete components? If in a part, could you affect the change at
the feature level rather than by face?

 

 

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Sorry
mate i should have made it a bit clearer, What i am trying to do is to apply
the render style to all of the faces at once. The method you suggested is what
i currently use but it applies the render style to every face one at a time.
Because the files i am using have thousands of faces this takes up a lot of
time to do it this way. So if anyone has any ideas it is much appreciated as
ive hit a brick wall on this one. Cheers
Message 5 of 5
matt_jlt
in reply to: matt_jlt

Thanks for the help guys, much appreciated.
It is for imported geometry. I ended up turning off screen refresh and added in some code to detect if a face is already part style to not perform the function on it, still not the results i was after but it's a little faster.

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

Post to forums  

Autodesk Design & Make Report