ilogic Event on mouse click

ilogic Event on mouse click

karolis.s
Advocate Advocate
851 Views
1 Reply
Message 1 of 2

ilogic Event on mouse click

karolis.s
Advocate
Advocate

Hello,

I am looking for solution to store hole diameter in variable and use it in INVENTOR CAM default properties.
So my question is: Is it possible to get diameter of hole with mouseclick event? I mean i want to click on hole in my partDocument and immediately get diameter of it. 

0 Likes
Accepted solutions (1)
852 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

I'm not familiar with Inventor CAM, but try this iLogic code to retrieve the diameter.

Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oCM As CommandManager = ThisApplication.CommandManager
Dim oHole As Face = oCM.Pick(SelectionFilterEnum.kPartFaceCylindricalFilter, "Select the Cylindrical Face of the hole you want to retrieve the Diameter from.")
If oHole.SurfaceType = SurfaceTypeEnum.kCylinderSurface Then
	Dim oCylinder As Cylinder = oHole.Geometry
	Dim oDia As Double = (oCylinder.Radius) * 2
	MsgBox("Diameter = " & oDia,vbInformation,"DIAMETER")
End If
'You could also store oDia as a Shared Variable to be able to use it in another rule.

Also, if you're just looking for a way to launch the Measure tool, you can try the following command.

ThisApplication.CommandManager.ControlDefinitions.Item("AppMeasureDistanceCmd").Execute

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

Here are a few of the ideas I like.
If you agree, please vote for them, so they might get implemented.

  • Options to format contents of MessageBox, InputBox, and InputListBox Click Here
  • Ability to fully constrain and dimension to the edjes of images within drawing title block sketches, SketchedSymbol sketches, other drawing sketches, and assembly sketches Click Here
  • Save section view status in DesignViewRepresentation, so it can be used in drawing view Click Here
  • Add SolidBodies folder to iLogic Rule Editor Model Tab Click Here
  • Convert all views to Raster before autosave stores to 'OldVersions' folder Click Here

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes