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 commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi all!
I`m starting to learn about iLogic, and have a couple of questions regarding this matter.
I`m using adaptive planes and the split command to cut the pipes to each other. After the cut plane is constrained I want the plane to be turned off automatically.
To achieve this I`v tried using a if command, without luck obviously.
IfConstraint.IsActive("all the parts to look in", "Work plane 3") Then
Feature.IsActive("that specific part", "Work plane 3")=False
Else
Feature.IsActive("that specific part" , "Work plane 3")=True
EndIf
Is this possible?
Kind regards
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Anyone?
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I have just attempted to solve your problem but I can't seem to find a command which will turn the Visability of a Work Plane off.
You need something similar to
If Constraint.IsActive("Mate:1")=True Then
WorkPlane.Visible("Work Plane1")=False
Else
WorkPlane.Visible("Work Plane1")=True
EndIf
but there is no such comand as 'WorkPlane.Visible' or 'WorkPlane.IsActive'
Inventor 2013 Certified Professional
Autodesk Inventor Professional 2011
Windows 7 Enterprise, 64-bit
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi 128848,
This link has several examples of iLogic to handle workplanes:
http://forums.autodesk.com/t5/Autodesk-Inventor/il
Keep in mind you might search and ask questions of this type on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Cu
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Have been trying out some codes, without luck.
'define document
Dim oDoc As PartDocument
oDoc = ThisDoc.Document
'look at the workplane collection
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
If oWorkPlane.Constraint.IsActive("Mate:1")=True Then
oWorkPlane.Visible =False
ElseIf oWorkPlane.Visible=False Then
oWorkPlane.Visible=True
EndIf
Next
Here`s the message I get.
Error in rule: Rule0, in document: Assembly5.iam
Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PartDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D463-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Any ideas whats wrong?
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi 128848,
First I've changed the Dim oDoc as PartDocument to Dim oDoc as Document to avoid the first issue (Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PartDocument').
Secondly, I've changed the line If oWorkPlane.Constraint.IsActive("Mate:1")=True Then to Constraint.IsActive("Mate:1")=True.
I think this will work for you now.
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 Document
oDoc = ThisDoc.Document
'look at the workplane collection
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
If Constraint.IsActive("Mate:1")=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 commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Awesome! Now we`re getting somewhere. No errors, however, the work plane is still visible.
And also, instead of specifying that specific mate "Mate:15" is there a symbol I can put in so it dosent matter if it`s mate 1 or mate 110?
Thanks for your help so far ![]()
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi 128848,
I'm not following how the constraints are being used to determine if the workplanes should be visible? Can you describe your goal here again?
Also, is your workplane in a part file or was it created in the assembly?
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: iLogic commands!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This one has slipped my mind.
The tilted part has 2 planes (within the part, not the assembly) and these two planes are constrained to the other parts. When they are constrained I would like to turn off the visibility. Horrible explanation, but did you get it?

