Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Feature.ThreadType

meck
Collaborator

Feature.ThreadType

meck
Collaborator
Collaborator

Hi All,

In the thread feature, is there a way to switch from ANSI Unified Screw Threads to ANSI Metric M Profile using iLogic? When I try using the code below it tells me it is read only.

 

If ThdType = "Metric" Then
 Feature.ThreadType("Thread1") = "ANSI Metric M Profile"
Else
 Feature.ThreadType("Thread1") = "ANSI Unified Screw Threads"
End If

 

I've also tried using...

 

If ThdType = "Metric" Then
 Feature.SetThread("Thread1", Thdx, "ANSI Metric M Profile", "6g")
Else
 Feature.SetThread("Thread1", Thdx, "ANSI Unified Screw Threads", "2A")
End If

 

I get an error saying "The thread designation "ANSI Unified Screw Threads" is not valid".

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes
Reply
Accepted solutions (1)
527 Views
3 Replies
Replies (3)

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

Hi Mike,  

 

The syntax of this method is

 

Feature.SetThread("featurename", "thread type", "thread designation", "thread class")

 

While it looks you specified the third argument as ‘Thread Type’?

 

In addition, you need to make sure the designation and class are valid with a thread type.  e.g. from Thread dialog, you can see the designation and class that are available with a type.

 

I simply tried with the code below, it works well.

 

currentType = Feature.ThreadType("Thread1")

MessageBox.Show(currentType, "Title")

Feature.SetThread("Thread1", "GB Metric profile", "M7x0.75", "6H")

 

 

 aa.jpg

0 Likes

meck
Collaborator
Collaborator

Wow. I've looked at that 9 different ways and everytime I missed that fact that I had the order of the arguments wrong.

 

Thanks!

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes

meck
Collaborator
Collaborator

To All,

How do I specify Left Hand or Right Hand thread using the above code?

 

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes