Ilogic - get hole diameter value from part within an assembly

Ilogic - get hole diameter value from part within an assembly

Anonymous
Not applicable
1,186 Views
4 Replies
Message 1 of 5

Ilogic - get hole diameter value from part within an assembly

Anonymous
Not applicable

HI,

 

Does anyone know how to get a hole diameter value from a part within an assembly using ilogic?

 

Similar to using the measure distance tool which gives you a measurement.

 

Cheers,

 

Tony

0 Likes
Accepted solutions (1)
1,187 Views
4 Replies
Replies (4)
Message 2 of 5

HermJan.Otterman
Advisor
Advisor

hello,

 

this is a verry general question...

the biggest problem will be to tell you iLogic/VB routine what hole needs to be measured, do you select it? or does it have a name

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi Hermjan,

 

I want to select the hole.

 

Thanks,

0 Likes
Message 4 of 5

HermJan.Otterman
Advisor
Advisor
Accepted solution

 

mainly from the Inventor API help:

 

 

    ' Get a feature selection from the user
    Dim oObject As Object
    oObject = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFeatureFilter, "Pick a feature")

    MsgBox("Picked: " & oObject.Name)
' if extrusion, the radius is:
  MsgBox(oObject.sidefaces.item(1).geometry.radius)

(the radius will be in centimeters!!!)

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Message 5 of 5

Anonymous
Not applicable

Hi Hermjan,

 

Thanks for that. I changed the kpartfeaturefilter to kallcircularentities and message box.

 

SyntaxEditor Code Snippet
' Get a Hole selection from the user
    Dim oObject As Object
    oObject = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kallcircularentities, "Pick a Hole")

    Hole_Dia = oObject.geometry.radius*2*10 'Converted to Diameter and mm
     MsgBox(Hole_Dia & "mm Diameter")

which worked better for me.

 

 

Cheers

 

Tony

0 Likes