How to select "Thread" feature

How to select "Thread" feature

wangdu
Collaborator Collaborator
1,198 Views
6 Replies
Message 1 of 7

How to select "Thread" feature

wangdu
Collaborator
Collaborator

Hi,

 

I have hit a wall when trying to figure out how to retrieve "Thread" feature through selection. Here's the code sample.

The Selection Filter:

 

InteractionEvents.SelectEvents.AddSelectionFilter(SelectionFilterEnum.kPartFeatureFilter);

The OnSelect Event Handler:

void SelectEvents_OnSelect(
            ObjectsEnumerator JustSelectedEntities, 
            SelectionDeviceEnum SelectionDevice, 
            Point ModelPosition, 
            Point2d ViewPosition, 
            Inventor.View View)
{
    foreach (System.Object obj in JustSelectedEntities)
    {
         var threadFeature = obj as ThreadFeature;
         if (threadFeature != null)
         {
              ThreadInfo threadInfo = threadFeature.ThreadInfo;
              //Do something with threadinfo
         }
     }
 }

This always pick up the Extrude feature when I click on a part (cylinder extrusion + thread). And I want to have instead the thread feature to be picked up by the selection.

Am I doing something wrong here? Please fill me in.

 

Wangdu

0 Likes
Accepted solutions (1)
1,199 Views
6 Replies
Replies (6)
Message 2 of 7

Balaji_Ram
Alumni
Alumni

Hi Wangdu,

 

I see a similar behavior in Inventor UI. When the selection filter is set to select features, the extrude gets selected and not the thread feature. 

To select the thread feature, you can select using the model browser.

 

The same is applicable for the selection using API. 

When the interaction event has started, you can select the thread feature from the model browser.

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 7

wangdu
Collaborator
Collaborator

Hi Balaji,

 

Thank you for response and the suggestion. Actually this is how the current implementation that I have is working - selecting through the model browser. However, there is a need for selecting thread of a "Tapped hole". It isn't possible to select it even through the model browser. Do you have some idea how to select those kind of threads?

 

Wangdu

0 Likes
Message 4 of 7

Balaji_Ram
Alumni
Alumni

Hi Wangdu,

 

I do not see any issue in selecting an internal thread from the model browser.

 

http://autode.sk/1HRThiG

 

Is there anything that i am missing ?

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 7

wangdu
Collaborator
Collaborator

Hi Balaji,

 

Thank you again for your response and the video you posted. You are right with the internal threads, which are working fine. But I am having problem with the thread in a Tapped hole or Taper Tapped hole. It doesn't show up in the model browser. 

 

What I have done is during creation of hole, i have selected the "Tapped Hole" (bunch of RadioButtons at the bottom of the dialog) instead of default "Simple hole". This selection resulted in not just a hole but a hole with thread. This way of creating thread doesn't have a thread feature node in the model browser.

 

I hope you may reproduce what I have faced. Looking forward to hear your response.

 

Regards,

Wangdu

 

0 Likes
Message 6 of 7

Balaji_Ram
Alumni
Alumni
Accepted solution

Hi Wangdu,

 

That is a hole feature and it may or maynot be threaded.

So there is no seperate thread feature associated with it. 

 

I do not think there is any way to only select its thread.

 

Would it not be possible for your application to let the user select the hole featue and then 

extract the thread info from it using its TapInfo ? You can also let the user select only the

hole features that are tapped.

 

Regards,

Balaji

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 7 of 7

wangdu
Collaborator
Collaborator

Hi Balaji,

 

Thanks, you have pointed me into right direction. I will check this out. 

 

Regards,

Wangdu

0 Likes