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: 

iLogic Rule to change solid body visibility

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
marcin_bargiel
3419 Views, 6 Replies

iLogic Rule to change solid body visibility

marcin_bargiel
Advocate
Advocate

I need iLogic Rule to change solid body visibility in IPT file. I DO NOT want to use "Feature.IsActive("featurename") but just VISIBILITY as i can by hand.

 

 

Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes

iLogic Rule to change solid body visibility

I need iLogic Rule to change solid body visibility in IPT file. I DO NOT want to use "Feature.IsActive("featurename") but just VISIBILITY as i can by hand.

 

 

Vote for REPLACE VARIES !
REPLACE VARIES
6 REPLIES 6
Message 2 of 7

Thomas_Savage
Advisor
Advisor

Hello,

 

You con use:

 

Component.Visible(" ")

 

In iLogic, expand the components tab, and you will see Visible.

 

Which will change the visibility of your component.

 

Hope this helps?

 

Thomas.



Thomas Savage

Design Engineer


0 Likes

Hello,

 

You con use:

 

Component.Visible(" ")

 

In iLogic, expand the components tab, and you will see Visible.

 

Which will change the visibility of your component.

 

Hope this helps?

 

Thomas.



Thomas Savage

Design Engineer


Message 3 of 7
ThomasB44
in reply to: marcin_bargiel

ThomasB44
Mentor
Mentor
Accepted solution

Hi @marcin_bargiel

This rule by @Curtis_Waguespack do this perfectly.

http://inventortrenches.blogspot.fr/2013/01/ilogic-solid-body-visibility.html


Thomas
Mechanical Designer / Inventor Professionnal 2025
Inventor Professional EESignature

Hi @marcin_bargiel

This rule by @Curtis_Waguespack do this perfectly.

http://inventortrenches.blogspot.fr/2013/01/ilogic-solid-body-visibility.html


Thomas
Mechanical Designer / Inventor Professionnal 2025
Inventor Professional EESignature

Message 4 of 7

marcin_bargiel
Advocate
Advocate
Components are in iam file ! So You didn't help...
I was talking about features in ipt file.
We can change visibility by 'hand' (click on one of chosen feature -multibody) but how to do this by ilogic rule ?????
Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes

Components are in iam file ! So You didn't help...
I was talking about features in ipt file.
We can change visibility by 'hand' (click on one of chosen feature -multibody) but how to do this by ilogic rule ?????
Vote for REPLACE VARIES !
REPLACE VARIES
Message 5 of 7

marcin_bargiel
Advocate
Advocate
Accepted solution

My rule, that works OK 😉

 

Sub Main()
VIS("feature name", False)  'visibility OFF

 

VIS("feature name", True)   'visibility ON

End Sub


Function VIS (FeatureName As String, Visibility As Boolean )
Dim oCompDef as ComponentDefinition
oCompDef = ThisDoc.Document.ComponentDefinition
Dim oBody As SurfaceBody
j=1
i=1
k=178  'number of features
For i=1 To k
    oBody = oCompDef.SurfaceBodies.Item(i)
    If oBody.Name= FeatureName Then
        j=i
        i=k
    End If
Next
oBody.Visible=Visibility
End Function

Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes

My rule, that works OK 😉

 

Sub Main()
VIS("feature name", False)  'visibility OFF

 

VIS("feature name", True)   'visibility ON

End Sub


Function VIS (FeatureName As String, Visibility As Boolean )
Dim oCompDef as ComponentDefinition
oCompDef = ThisDoc.Document.ComponentDefinition
Dim oBody As SurfaceBody
j=1
i=1
k=178  'number of features
For i=1 To k
    oBody = oCompDef.SurfaceBodies.Item(i)
    If oBody.Name= FeatureName Then
        j=i
        i=k
    End If
Next
oBody.Visible=Visibility
End Function

Vote for REPLACE VARIES !
REPLACE VARIES
Message 6 of 7

marcin_bargiel
Advocate
Advocate

Solution above works - but when we have a large number of features it works slowly.

 

Is there any other way to change visibility ? without need to know exact item number (and need to use loop "for" or "while")

 

something like this oCompDef.SurfaceBodies.Item("features name")= False

Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes

Solution above works - but when we have a large number of features it works slowly.

 

Is there any other way to change visibility ? without need to know exact item number (and need to use loop "for" or "while")

 

something like this oCompDef.SurfaceBodies.Item("features name")= False

Vote for REPLACE VARIES !
REPLACE VARIES
Message 7 of 7

jeamy.baena
Advocate
Advocate

Hi, @marcin_bargiel 

 

In my case, your code worked like a charm!!! 👏. This is all that I needed 😀

 

Thank very much!!!

0 Likes

Hi, @marcin_bargiel 

 

In my case, your code worked like a charm!!! 👏. This is all that I needed 😀

 

Thank very much!!!

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

Post to forums  

Autodesk Design & Make Report