Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

AskSymbThreadParms - unknow feature type

Status
Not open for further replies.

niedzviedz

Mechanical
Apr 1, 2012
307
Hello

I have journal to color all cylindrical faces which are part of thread feature. Everything works perfects on NX12. When I switch to NX2007, it's stopped working. I receive information:

Code:
NXOpen.NXException: Unknown feature type in NXOpen.UF.UFModl.AskSymbThreadParms(Tag thread_obj_id, SymbThreadData_parameters)

in line

Code:
theUfSession.Modl.AskSymbThreadParms(myFeature.Tag, myThreadParameters)

Does anybody have idea how to solve it?


With best regards
Michael
 
Replies continue below

Recommended for you

From the NXOpen documentation:

NXOpen Help said:
Overview
Get parameters of a thread feature.

IMPORTANT:
"NXOpen.Features.Thread" classes have been introduced in NX1926 to create, edit and query threads.
Thread feature use thread standard file from environment variable UGII_THREADED_HOLE_STANDARD_DIR for features
created interactively or using thread NXOpen classes in NX1926 and later.
UF_MODL_ask_symb_thread_parms() will get parameters of pre-NX1926 thread feature or which are created using UF functions.
Otherwise it will return an error.

It sounds like if the thread feature was created (or "renewed") in NX 2007, you will need to use the new thread functions to query it.

www.nxjournaling.com
 
Yeah, they added the whole symbolic thread stuff into the "modern" NXOpen, while simultaneously obsoleting the old C function wrappers back in 1926 or so. This function will now only work for the old pre-1926 holes.

You'll have to re-record/rewrite the Journal using the "modern" functions, specifically the NXOpen.Features.ThreadBuilder class.
 
Thanks for the answer. I looked into documentation about NXOpen.Features.Thread, but there is not much there about it.

Below is my old code:

Code:
Option Strict Off

Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpen.UF
 
Module Module1
 
	Dim theSession As Session = Session.GetSession()
	Dim theUfSession As UFSession = UFSession.GetUFSession()
	Dim workPart As Part = theSession.Parts.Work
	Dim lw As ListingWindow = theSession.ListingWindow
	Dim displayModification1 As DisplayModification
	Dim facecolor as integer = 163
	
	Sub Main()
		lw.Open()
  
		Dim threadFeatures As New List(Of Features.Feature)
		Dim threadFaces As New List(Of Face)
 
		For Each myFeature As Features.Feature In workPart.Features
		
			If myFeature.FeatureType.ToUpper = "SYMBOLIC_THREAD" Then
			
				threadFeatures.Add(myFeature)
				'lw.writeline(myFeature.tag.tostring)		
			End If		
		Next
 
		Dim myThreadParameters As UFModl.SymbThreadData
		
		For Each myFeature As Features.Feature In threadFeatures
		
			try 	
				theUfSession.Modl.AskSymbThreadParms(myFeature.Tag, myThreadParameters)
				Dim threadedFace As Face
				threadedFace = Utilities.NXObjectManager.Get(myThreadParameters.cyl_face)	 
				threadFaces.Add(threadedFace)
			
				Catch ex01 As NXException
				
					If ex01.ErrorCode = 512008 Then
						
					Else

						'lw.WriteLine("error: " & ex01.ErrorCode & ", " & ex01.Message)
				End If				
			end try	
		Next
 
		displayModification1 = theSession.DisplayManager.NewDisplayModification()
		With displayModification1	
			.ApplyToAllFaces = False
			.NewColor = facecolor
			.Apply(threadFaces.toarray)
			.Dispose()
		End With 
		lw.Close()
	End Sub
End Module

With best regards
Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor