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

(Not an Autodesk Employee)