Autodesk Inventor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Is there a way to turn off visibility on work planes using ilogic? Also, is there a way to change an extrusion type from an assymetrical extrusion to a one direction extrusion using ilogic?
Solved! Go to Solution.
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This will turn the visibility of Work Plane1 off
Dim
oDoc As PartDocument
oDoc
= ThisDoc.Document
For Each
oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
If oWorkPlane.Name = "Work Plane1" Then
'
oWorkPlane.Visible = False
'
End If
Next
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi rjones0215,
Here's another rule that toggles all of the workplanes on/off.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'define document Dim oDoc As PartDocument oDoc = ThisDoc.Document 'look at the workplane collection For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes 'toggle all work planes If oWorkPlane.Visible = True Then oWorkPlane.Visible = False ElseIf oWorkPlane.Visible = False Then oWorkPlane.Visible = True End If Next

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Nice rule Curtis
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
thank you. These definitely help.
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
How can I make this work so that from an assembly plane visibility is changed to false in all sub assemblies and and parts.
Thanks
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Diswill,
Here are 2 quick rules that should give you an idea of how to do this. I didn't take a lot of time to test this, so be warned that you might bump into issues with locked design view reps, etc. But this should get you pointed in the right direction I think.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
sample rule #1
'get user input
oInput = InputRadioBox("Select workplane visibility:", _
"Turn ON workplanes for all components", "Turn OFF workplanes for all components", "True", "iLogic")
'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document
'Look at all of the files referenced in the open document
Dim docFile As Document
For Each docFile In openDoc.AllReferencedDocuments
'format file name
Dim FNamePos As Long
FNamePos = InStrRev(docFile.FullFileName, "\", -1)
Dim docFName As String
docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)
For Each oWorkPlane In docFile.ComponentDefinition.WorkPlanes
'toggle all work planes
If oInput = True Then
oWorkPlane.Visible = True
ElseIf oInput = False Then
oWorkPlane.Visible = False
End If
Next
Next
iLogicVb.UpdateWhenDone = True
sample rule #2
'toggle work planes on, if off & off if on 'Define the open document Dim openDoc As Document openDoc = ThisDoc.Document 'Look at all of the files referenced in the open document Dim docFile As Document For Each docFile In openDoc.AllReferencedDocuments 'format file name Dim FNamePos As Long FNamePos = InStrRev(docFile.FullFileName, "\", -1) Dim docFName As String docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) For Each oWorkPlane In docFile.ComponentDefinition.WorkPlanes 'toggle all work planes If oWorkPlane.Visible = True Then oWorkPlane.Visible = False ElseIf oWorkPlane.Visible = False Then oWorkPlane.Visible = True End If Next Next iLogicVb.UpdateWhenDone = True

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
working with your sample 1
user defined planes are not switching.
if I make a offset plane from orgin plane xy when I run sample 1 the plane I created is unaffected by this rule.
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Diswill,
Sample#1 should have worked for your original request "plane visibility is changed to false in all sub assemblies and and parts.", but if you have user workplanes at the top level assembly as well, then you might need to add a few lines to look at the workplane collection in the top level assembly, as in example #3 below.
Again the issue could be with locked design view representations as well. It's difficult to guess without more details, but hopefully this example will help you work it out.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
sample rule #3
'get user input
oInput = InputRadioBox("Select workplane visibility:", _
"Turn ON workplanes for all components", "Turn OFF workplanes for all components", "True", "iLogic")
'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document
'toggle work planes in the open document (top level assembly)
For Each oWorkPlane In openDoc.ComponentDefinition.WorkPlanes
'toggle all work planes
If oInput = True Then
oWorkPlane.Visible = True
ElseIf oInput = False Then
oWorkPlane.Visible = False
End If
Next
'Look at all of the files referenced in the open document
Dim docFile As Document
For Each docFile In openDoc.AllReferencedDocuments
'format file name
Dim FNamePos As Long
FNamePos = InStrRev(docFile.FullFileName, "\", -1)
Dim docFName As String
docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)
For Each oWorkPlane In docFile.ComponentDefinition.WorkPlanes
'toggle all work planes
If oInput = True Then
oWorkPlane.Visible = True
ElseIf oInput = False Then
oWorkPlane.Visible = False
End If
Next
Next
iLogicVb.UpdateWhenDone = True

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: ilogic and work plane visibility
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Please let me claifiry
the current code I have is
'get user input
oInput=InputRadioBox("Select workplane visibility:", _
"Turn ON workplanes for all components", "Turn OFF workplanes for all components", "True", "iLogic")
'catches planes in current assembly
IfoInput=FalseThen
'define document
DimoDocAsAssemblyDocumentoDoc=ThisDoc.Document
'look at the workplane collection
For EachoWorkPlaneInoDoc.ComponentDefinition.WorkPlanes
'toggle all work planes off
IfoWorkPlane.Visible=TrueThenoWorkPlane.Visible=False
End If
Next
ElseIfoinput=TrueThen
'define document
DimoDocAsAssemblyDocumentoDoc=ThisDoc.Document
'look at the workplane collection
For EachoWorkPlaneInoDoc.ComponentDefinition.WorkPlanes
'toggle all work planes on
IfoWorkPlane.Visible=FalseThenoWorkPlane.Visible=True
End If
Next
End If
'catches some planes in subassemblies
'Define the open document
DimopenDocAsAssemblyDocumentopenDoc=ThisDoc.Document
'Look at all of the files referenced in the open document
DimdocFileAsDocumentForEachdocFileInopenDoc.AllReferencedDocuments
'format file name
DimFNamePosAsLong
FNamePos=InStrRev(docFile.FullFileName, "\", -1)
DimdocFNameAsString
docFName=Right(docFile.FullFileName, Len(docFile.FullFileName)-FNamePos)For EachoWorkPlaneIndocFile.ComponentDefinition.WorkPlanes
'toggle all work planes
IfoInput=TrueThenoWorkPlane.Visible=True
ElseIfoInput=FalseThen
oWorkPlane.Visible=False
End If
Next
Next
iLogicVb.UpdateWhenDone=True
However when I open Assembly 2 the plane appears to be toggling correctly. It just appears not to reflect correctly up to assembly1.
How do I fix?
Thanks in Advance



