Inventor General Discussion

Reply
Active Contributor
128848
Posts: 31
Registered: ‎01-16-2013
Message 1 of 9 (1,050 Views)

iLogic commands!

1050 Views, 8 Replies
01-16-2013 08:15 AM

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

Capture.JPG

 

Is this possible?

 

Kind regards

 

 

 

Active Contributor
128848
Posts: 31
Registered: ‎01-16-2013
Message 2 of 9 (1,019 Views)

Re: iLogic commands!

01-17-2013 05:49 AM in reply to: 128848

Anyone?

Distinguished Contributor
waynehelley
Posts: 137
Registered: ‎09-10-2012
Message 3 of 9 (1,006 Views)

Re: iLogic commands!

01-17-2013 06:55 AM in reply to: 128848

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'

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
*Expert Elite*
Curtis_Waguespack
Posts: 2,930
Registered: ‎03-08-2006
Message 4 of 9 (997 Views)

Re: iLogic commands!

01-17-2013 07:20 AM in reply to: 128848

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



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Active Contributor
128848
Posts: 31
Registered: ‎01-16-2013
Message 5 of 9 (919 Views)

Re: iLogic commands!

01-24-2013 09:11 AM in reply to: Curtis_Waguespack

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?

*Expert Elite*
Curtis_Waguespack
Posts: 2,930
Registered: ‎03-08-2006
Message 6 of 9 (914 Views)

Re: iLogic commands!

01-24-2013 09:19 AM in reply to: 128848

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

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Active Contributor
128848
Posts: 31
Registered: ‎01-16-2013
Message 7 of 9 (883 Views)

Re: iLogic commands!

01-25-2013 06:52 AM in reply to: Curtis_Waguespack

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 :smileyhappy:

*Expert Elite*
Curtis_Waguespack
Posts: 2,930
Registered: ‎03-08-2006
Message 8 of 9 (871 Views)

Re: iLogic commands!

01-25-2013 07:15 AM in reply to: 128848

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



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Active Contributor
128848
Posts: 31
Registered: ‎01-16-2013
Message 9 of 9 (813 Views)

Re: iLogic commands!

02-05-2013 11:37 AM in reply to: Curtis_Waguespack

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?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.