
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
So I'm trying to get thread data for external threads in a part file.
I noticed that when the model states differ in the thread designation a feature uses, the `.MajorDiameterMax` property becomes empty and the `.MajorDiameterMin` property takes its value--or something like it--instead.
To reproduce this, make a part file with external thread, create a model state and ensure member edit scope is set to active member and change the thread through the feature (changing part geometry as necessary).
Can someone please confirm whether this is/is not working for them?
Here's a simple test script to display the values obtained.
Thanks
Edit: it looks like what it's actually doing is getting all the internal thread data instead, which both explains why the `.MajorDiameterMax` is missing and why the values that do obtain are slightly off from what's expected.
Sub Main
Dim oCompDef As PartComponentDefinition = ThisDoc.Document.ComponentDefinition
For Each oMS As ModelState In oCompDef.ModelStates
oMS.Activate
For Each oThreadFeature As ThreadFeature In oCompDef.Features.ThreadFeatures
Dim oThreadData As StandardThreadInfo = oThreadFeature.ThreadInfo
MsgBox(
"Model State: " + oMS.Name + vbCrLf + vbCrLf _
+ oThreadData.ThreadDesignation + vbCrLf _
+ "Internal: " & oThreadData.Internal & vbCrLf + vbCrLf _
+ "Major Max: " & oThreadData.MajorDiameterMax & vbCrLf _
+ "Major Min: " & oThreadData.MajorDiameterMin & vbCrLf _
+ "Minor Max: " & oThreadData.MinorDiameterMax & vbCrLf _
+ "Minor Min: " & oThreadData.MinorDiameterMin & vbCrLf
)
Next
For Each oHoleFeature As HoleFeature In oCompDef.Features.HoleFeatures
Dim oThreadData As StandardThreadInfo = oHoleFeature.TapInfo
MsgBox(
"Model State: " + oMS.Name + vbCrLf + vbCrLf _
+ oThreadData.ThreadDesignation + vbCrLf _
+ "Internal: " & oThreadData.Internal & vbCrLf + vbCrLf _
+ "Major Max: " & oThreadData.MajorDiameterMax & vbCrLf _
+ "Major Min: " & oThreadData.MajorDiameterMin & vbCrLf _
+ "Minor Max: " & oThreadData.MinorDiameterMax & vbCrLf _
+ "Minor Min: " & oThreadData.MinorDiameterMin & vbCrLf
)
Next
Next
End Sub
Solved! Go to Solution.