Assist with NPT declaration

Assist with NPT declaration

llorden4
Collaborator Collaborator
419 Views
2 Replies
Message 1 of 3

Assist with NPT declaration

llorden4
Collaborator
Collaborator

I'm not finding a lot of documentation on this feature, thus the reach out for assist.

I'm trying to add some threaded features to pipe, but I'm getting an error when attempting to define the thread information.

Dim oDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oThreadFeatures As ThreadFeatures = oCompDef.Features.ThreadFeatures
oThreadInfo = oThreadFeatures.CreateTaperedThreadInfo(False, True, "NPT", "1/2 - 14 NPT")	'This creates an error

 I suspect the issue is the exact naming of the thread feature, using the manual method I'm copying the visual display as a reference since I can't locate a data table.

llorden4_0-1633382021157.png

I'm not seeing an option to create custom thread length values (if needed).  Information I am locating is quite diverse in presentation and gives only tiny bits of information to draw from.  Some documentation shows spaces used in the thread descriptions while others do not and without a table to look up I can't tell what's correct to use.

 

A few links to info I did find:

Link 1

Link 2

 

I'll likely also have to figure out how to get the pipe thread to show up on the end of pipe I want, so looking for that information as well.

 

Anyone know of a good resource to assist here or have figured this out in order to share the process?  I am setting up routines for a range of pipe sizes, so please don't limit the response to only solving the 1/2" pipe option currently displayed in this example.

Autodesk Inventor Certified Professional
0 Likes
Accepted solutions (1)
420 Views
2 Replies
Replies (2)
Message 2 of 3

TomaszDąbrowski
Enthusiast
Enthusiast
Accepted solution

You can check all currently set thread's properties in locals window (in VBA editor).

aa1.pngAs you can see, in this example you just need to change in your code "1/2 - 14 NPT" into "1/2"

 

My hint is to first set a thread and next chceck it's designation in locals window.

Message 3 of 3

llorden4
Collaborator
Collaborator

Thanks, that got me on track.  All I needed was the values from the Size and Type fields, got the rest all figured out.

Autodesk Inventor Certified Professional
0 Likes