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

Feature.ThreadType

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
xiaodong_liang
in reply to: meck

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

meck
in reply to: xiaodong_liang

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
meck
in reply to: xiaodong_liang

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