Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Parasolid Export Naming

Status
Not open for further replies.

snydeja

Mechanical
Oct 5, 2011
18
I need to export assembly parts and assemblies to a parasolid format for my toolroom, and instead of exporting each part and naming each parasolid, I wanted to export the entire assembly. The issue we are having is that once you re-open the parasolid in NX, it doesn't retain the part names. For that matter, once you open the parts in Master Cam, it does not have part names. Is there any way to have it ratain the part names?

I understand that this is not the best method and we can send .step files or just send the standard NX file, but I was hoping that there was a method to name the dumb solids, possibly some parameter I can fill in? Apparently parasolids are preffered by the guys in our toolroom.
 
Replies continue below

Recommended for you

You are right in stating that STEP would be a better route to take in this situation.
There really is not an easy way to rename each parasolid component - but maybe there is a way to to it with "journaling" that I am not aware of.
 
I did a quick search because I know this has come up before (and often it would appear). Unfortunately, I did not find a workable solution other than 'use STEP files'.

The end of thread561-305870 mentions opening an IR, perhaps you should contact GTAC and add your vote to this one.

 
If you are using TC with UG then STEP will name the parts using the item ID or part number. It will not retain the part name. There may be a better way but my current workflow to create a STEP of an assembly and have the part names come over is this.

1 - export assembly outside teamcenter
2 - you will need to define a naming rule "${db_Part_name} which will use the part name instead of the item ID.
3 - Open a standalone version of UG.
4 - read in the exported assembly.
5 - export a STEP file of the assembly.
You will now have a STEP file of the assembly which will retain the part names when you read it into another CAD/CAM package. If that software supports assembly structure.
 
Here's a quick proof of concept journal I put together; run it, select a few solids from your assembly, then open the parasolid file and see if it gives you something useful. If it does (or if it can be made to do so) I can update it to run through an entire assembly automatically.

Code:
' NX 7.5.0.32
'
Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim lw As ListingWindow = theSession.ListingWindow
Dim mySelectedObjects() as NXObject
Dim myResponse as Selection.Response
Dim tagList() As NXOpen.Tag
Dim tags as new ArrayList
Dim strParasolid As String

lw.Open

strParasolid = workPart.FullPath
strParasolid = Left(strParasolid, Len(strParasolid) - 4)
strParasolid = strParasolid & ".x_t"

myResponse = SelectObjects(mySelectedObjects)
if (myResponse = Selection.Response.Cancel) OrElse (myResponse = Selection.Response.Back) then
	'user canceled selection, exit journal
	exit sub
end if

For each obj as Body in mySelectedObjects
	if obj.IsOccurrence then
		obj.SetName(obj.OwningComponent.DisplayName)
	else
		obj.SetName(obj.OwningPart.Leaf)
	end if
	tags.Add(obj.Tag)
Next

tagList = CType(tags.ToArray(GetType(NXOpen.Tag)), NXOpen.Tag())

ufs.Ps.ExportData(tagList, strParasolid)
lw.WriteLine("Output file: " & strParasolid)
lw.Close

End Sub

	Function SelectObjects(ByRef selobj() As NXObject) As Selection.Response
		
		Dim theUI As UI = UI.GetUI
		Dim prompt as String = "Select Solid Bodies"
		Dim title As String = "Selection"
		Dim includeFeatures As Boolean = False
		Dim keepHighlighted As Boolean = False
		Dim selAction As Selection.SelectionAction = _
			Selection.SelectionAction.ClearAndEnableSpecific
			
		Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
		Dim selectionMask_array(0) As Selection.MaskTriple
		
		With selectionMask_array(0)
			.Type = UFConstants.UF_solid_type
			.Subtype = 0
			.SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_BODY
		End With
		
		Dim resp As Selection.Response = theUI.SelectionManager.SelectObjects( _
			prompt, title, scope, selAction, _
			includeFeatures, keepHighlighted, selectionMask_array, selobj)
		
		Return resp
		
	End Function

	
End Module

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor