Inventor API - Change the Selection Filter in Part Environments

Inventor API - Change the Selection Filter in Part Environments

Khoa_NguyenDang
Advocate Advocate
1,658 Views
4 Replies
Message 1 of 5

Inventor API - Change the Selection Filter in Part Environments

Khoa_NguyenDang
Advocate
Advocate

Hi all guys 

 

Have a nice day first

I am finding a way to change the Select Filter in Part Environment with API Code (VBA, C#) (like in the picture)

Khoa_NguyenDang_0-1608698195537.png

Does anybody have experience with access to it and change the select filter?

If anyone knows about it, hope you can help me 

Thank you so much

 

 

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

dutt.thakar
Collaborator
Collaborator

@Khoa_NguyenDang 

 

Please post your API questions to Inventor Customization forum.

 

See if this helps.

If you are using Pick method you can change selection filter there from SelectionFilterEnum object. So Your code will look something like this.

 

ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select Face")

 

See this link which has the list of different Enumerators that can be used in selection filter for changing the selection  type.

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-0CF01252-5F21-4329-AFC2-E1B1277DA3BA

 

Hope this is helpful.

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 3 of 5

Khoa_NguyenDang
Advocate
Advocate

hi @dutt.thakar 

 

Thank you for your reply

I know about the Pick method in Inventor, it can help to change the select filter 

But out of Pick method, do you have any method else to change

I just want to change, do not want use Pick Method

0 Likes
Message 4 of 5

dutt.thakar
Collaborator
Collaborator
Accepted solution

@Khoa_NguyenDang 

 

Ok, If you want to change the selection filter in general for the Part document, Try this code

 

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
oDoc.SelectionPriority = SelectionPriorityEnum.kBodySelectionPriority

 In this case, SelectionPriorityEnum will work, check this out and you will be able to see different enum values that will be used for different selection type. You can use the same enumerator in Part, Assembly, Drawing, and Presentation document, you just need to change the document type.

 

Hope this will be helpful.

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 5 of 5

Khoa_NguyenDang
Advocate
Advocate

@dutt.thakar 

Yeah! That right what I need

Thank you so much @dutt.thakar 

One more thing, hope you know about this 

I want to create a feature  (thicken) when Part in the Edit mode of Assembly by API

I used Document oDoc = _invApp.ActiveEditDocument;

But at the time create Thicken Feature, the error occur

Do I miss to declare any item?

Khoa_NguyenDang_0-1608735957042.png

 

0 Likes