NPT Thread Length does not update with iLogic Feature.ThreadDesignation

NPT Thread Length does not update with iLogic Feature.ThreadDesignation

jrobinson
Advocate Advocate
766 Views
2 Replies
Message 1 of 3

NPT Thread Length does not update with iLogic Feature.ThreadDesignation

jrobinson
Advocate
Advocate

I was attempting to write a simple iLogic form to handle a few pipe sizes with NPT threads. I created a Thread Feature ("Thread1") on my pipe, turned off "Full Length" and set Specification Thread Type = NPT and Size = 1.

 

Under Parameters I have OD and ID for the model and a User Defined multi-value parameter called SIZE with values 1, 1.5, and 2 and added this parameter to my iLogic form. Then I created a Rule with this code:

 

Select Case SIZE

Case 1
OD = 1.315
ID = 1.049

Case 1.5
OD = 1.900
ID = 1.610

Case 2
OD = 2.375
ID = 2.067

End Select

Feature.ThreadDesignation("Thread1") = FormatAsFraction(SIZE)

 

The form works as expected and it sets the correct NPT Thread Size, but oddly it does not update the length. Thread lengths should be for Size 1 = 0.985 in, Size 1 1/2 = 1.025 in, Size 2 = 1.058 in. These values appear in the Length field when you change the Size under Edit Feature for Thread, even though it's greyed out when Thread Type is set to NPT.

 

Using the iLogic form to select Size and have the rule change the thread should update its thread length, but it remains the same unless you go Edit Feature for Thread and change the size there. Only then you can notice the visual change to the model. But how can I trigger this change using iLogic code? I noticed Inventor creates a dimension parameter for the thread length which gets updated when clicking Apply under the Edit Feature for Thread. I guess I could name this parameter TL and set the thread length manually in my code, but I shouldn't have to. Any one have any ideas why this doesn't update accordingly or how to force the change to occur in iLogic?

 

0 Likes
Accepted solutions (1)
767 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi jrobinson,

 

When you create a Thread feature, there is a model parameter created. You'll need to add that parameter to your Select Case statement.

 

Thread Length.png

 

 

 

In this example I've renamed model parameter d14 to ThreadLength. See attached Inventor 2015 file

 

Select Case SIZE

Case 1
OD = 1.315
ID = 1.049
ThreadLength = 0.985

Case 1.5
OD = 1.900
ID = 1.610
ThreadLength = 1.025

Case 2
OD = 2.375
ID = 2.067
ThreadLength = 1.058

End Select

Feature.ThreadDesignation("Thread1") = FormatAsFraction(SIZE)
InventorVb.DocumentUpdate()

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 3

jrobinson
Advocate
Advocate

Yeah, I noticed the parameter that was created as noted in my original post and what you suggested is what I ended up doing.

 

I was just hoping that I wouldn't have to define the thread length individually based on the NPT pipe size chart values I have on a sheet. It seems that Inventor is aware of these values already as it sets them correctly when you actually edit the Thread Feature despite that it has the Length field greyed out when Full Length is not checked and Thread Type = NPT.

 

I figured when there is no class or designation for the thread, only the size, that setting this in iLogic would also apply the typical length, but sadly it does not. Seems like a bug that's probably been there for a long time. Smiley Embarassed

 

Thanks though!

0 Likes