Inventor General Discussion

Reply
New Member
WEZ69
Posts: 2
Registered: ‎01-02-2013
Message 1 of 2 (452 Views)

How to create an iLogic rule to measure between 2 planes

452 Views, 1 Replies
01-03-2013 08:04 AM

How to create a measurement between two planes using ilogic rules?

 

I have created the planes on the asssmbly parts but dont know how to directly pick them.

 

The measurement is going to be used as reference dimension

 

Thanks

 

 

*Expert Elite*
Curtis_Waguespack
Posts: 2,814
Registered: ‎03-08-2006
Message 2 of 2 (442 Views)

Re: How to create an iLogic rule to measure between 2 planes

01-03-2013 09:21 AM in reply to: WEZ69

Hi WEZ69,

 

Here is a  quick example rule that allows the user to select from a list:

 

'Dim oDoc As AssemblyDocument
'oDoc = ThisApplication.ActiveDocument

Dim MyArrayList As New ArrayList

'look at the workplane collection
'and add each workplane to the select set
For Each oWorkPlane In ThisDoc.Document.ComponentDefinition.WorkPlanes
'filter out the origin planes
If oWorkPlane.IsCoordinateSystemElement = False Then
'add planes to list
MyArrayList.add(oWorkPlane.Name)
End If
Next

'select first plane to use
oWorkPlane1 = InputListBox("Select the 1st plane to use from the list.", MyArrayList , MyArrayList.item(0), "iLogic", "Workplanes")
'select second plane to use
oWorkPlane2 = InputListBox("Select the 2nd plane to use from the list.", MyArrayList , MyArrayList.item(1), "iLogic", "Workplanes")

'get distance
myDistance = Measure.MinimumDistance(oWorkPlane1, oWorkPlane2)
'display distance in cm's
MessageBox.Show(myDistance & " cm", "iLogic")
'display distance in inches
MessageBox.Show(myDistance * 0.393701 & " in", "iLogic")

 

Also, if you know the names of the planes ahead of time you could just use something like this example:

 

'get distance between named work planes
myDistance = Measure.MinimumDistance("Work Plane2", "Work Plane5")
'display distance in cm's
MessageBox.Show(myDistance & " cm", "iLogic")
'display distance in inches
MessageBox.Show(myDistance * 0.393701 & " in", "iLogic")

 

Keep in mind that in the future you might have better luck searching and asking 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.





You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube