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.
Solved! Go to Solution.
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.
Solved! Go to Solution.
Solved by marcin_bargiel. Go to Solution.
Solved by ThomasB44. Go to Solution.
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.
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.
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
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
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
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
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
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
Hi, @marcin_bargiel
In my case, your code worked like a charm!!! 👏. This is all that I needed 😀
Thank very much!!!
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.