Read the Name of Highlighted Feature with iLogic, Inventor 2022

Read the Name of Highlighted Feature with iLogic, Inventor 2022

OSEM_88
Explorer Explorer
378 Views
1 Reply
Message 1 of 2

Read the Name of Highlighted Feature with iLogic, Inventor 2022

OSEM_88
Explorer
Explorer

Hi Everyone,

 

I am new to Inventor and iLogic so I apologize if this question has already been answered. Is there a way to read the name of a highlighted feature within an assembly with iLogic? Let's say, this collar has Extrusion1 and the text shows up when I select it in the Feature Priority mode. Wondering if I can somehow capture this name with iLogic.

Thanks in advance.

Untitled.png

0 Likes
379 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

Here is option 1 to use part priority first and have the feature selected before running the rule and capture the selection using SelectSet. Sample can be found here in the API help near the top .

 

   ' Get the first item in the select set. This assumes it is a feature.
    If ThisApplication.ActiveDocument.SelectSet.Count > 0 Then
        Dim oFeature As PartFeature
        oFeature = ThisApplication.ActiveDocument.SelectSet.Item(1)
		MessageBox.Show(oFeature.Name, "Title")
    Else
        MsgBox ("You must select a feature.")
    End If
	

 Here is option 2 to run the rule and use the pick function and specify what type of object you want to pick. Sample can be found here in the API Help

' Get the selected feature from the select set.
    Dim oFeature As PartFeature
    oFeature= ThisApplication.CommandManager.Pick _
     (Inventor.SelectionFilterEnum.kPartFeatureFilter, _
                "Select a drawingCurve")
				MessageBox.Show(oFeature.Name, "Title")
If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes