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
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'
Hi 128848,
This link has several examples of iLogic to handle workplanes:
http://forums.autodesk.com/t5/Autodesk-Inventor/ilogic-and-work-plane-visibility/m-p/3383929#M429508
Keep in mind you might search and ask questions of this type on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
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?
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
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 🙂
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
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?
Can't find what you're looking for? Ask the community or share your knowledge.