Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Converting a UG assembly file into a single part file with component names and attributes 1

Status
Not open for further replies.

gcrow

Automotive
May 23, 2013
25
0
0
US
We have to upload our asm files into our OEM teamcenter. We have been getting away with putting our asm files in as bulk parasolid files. The oem now wants us to supply individual part files because when they open the file all the see is "body" in the part navigator. I have been going through this site trying to find a journal or work around with no luck. What i need is a way that i can get a single file with with parasolids that show the component name, has material associated with it. I know you can do this manually but there is no association and will have to be done every time we put somehting in teamcenter. We have attributes in the file sucha as DB_PART_NAME and P_MAT that i would like to be added to the solids. Ive tried wave and that only shows as linked body and doesn't have the part name or material. Catia has a function called generate CATPART from PRODUCT that that converts an asm file into a single part file and names the bodys the file names. This is what i need in UG.
 
Replies continue below

Recommended for you

They want to be able to select a body and be able to tell what component it is. There is only one OEM part number for the assembly and technically that is all we supply. Our assembly we design is broken up into individual stampings that our plants make. We do not want to maintain 2 sets of data and temacenter is really slow. We want something that we can just combine into one file that shows oue assembly structure. I like UG a lot more than Catia but the CATPART function in CATIA is verry nice.
 
Here is the workflow I have been using for bodies in weldments or linked bodies...

Turn off Timestamp Order in the Assy Navigator
From the Assy Navigator, select a body that you wish to add attributes
Add attributes to the body's properties (i.e. DESC, CALLOUT, etc) or you can simply name the body under the General tab
Repeat for each part body
Turn Timestamp Order back on

Hope this helps!

“Know the rules well, so you can break them effectively.”
-Dalai Lama XIV
 
EWH,
Where is the turn off time stamp order? I'm not seeing it. So are you wave linking an assembly file into a single part file? I've tried this and it only displays as linked bodies. Trying to find something that is somewhat automated like a journal or grip program. We have a lot of assemblies with up 30 separate stampings and having to select each individually and assign part attributes would be very time consuming. I'll try your method just need to find turn off time stamp.
 
If you only require that the bodies have descriptive names and don't need to populate a parts list, follow this work flow...

1) RMB over the desired body and pick Properties
2) Choose the General tab and assign a feature name. This will appear when you hover the curser over the body in modeling, the same as generic block would show "Block".
3) Yes, it can seem time consuming, but as with much in NX once you get the flow down it moves quickly.

If you wish to automatically populate a parts list with these bodies, you need to include the Timestamp Order step. RMB over the "Name" row in the Part Navigator - you should see a check box for timestamp order.

You don't have to wave-link the bodies to do this; I included them only as an explanation of how to get assy dwg balloons and the parts list to both update properly when wave-linked bodies are used in an assy.

“Know the rules well, so you can break them effectively.”
-Dalai Lama XIV
 
Thanks Cowski. I tried that yesterday but it didn't seem to do what i wanted. After i toggled the Part Navigator/ timestamp that EWH mentioned i see that it shows the component names. Awsome! That is what i was looking for. Is there a way to modify the journal to have it load the material properties?
 
Cowski, I ran that journal the first time and it worked great. Went to run it agoin and i get a
NXOpen.NXException: Modeler error: argumant is still referenced. Any ideas what's up?
 
Cowski, it seems to be running fine now. We are NX7.5 but switching to 8.0 next week. I think the problem might have been that it can't overwrite a file that already exists. Not sure. Still trying to figure out some of this journal terminology. I'd like this journal to name the bodies the component name without have to switch the part navigator to "timestamp order". That way no matter who opens it the solid bodies would have the component name displayed. Any ideas?
 
gcrow said:
I'd like this journal to name the bodies the component name without have to switch the part navigator to "timestamp order". That way no matter who opens it the solid bodies would have the component name displayed. Any ideas?

If you run this journal then open the parasolid file directly (change the file open type to ".x_t"), it will open a parasolid assembly where the assembly structure is preserved, but component names have been appended with a parasolid ID such as "_id##_x_t". Individual component files will be created. In the individual parasolid component files (part files that contain a single "body" feature), the name will show up in the feature tree whether or not you are in timestamp mode.

If you import the resulting parasolid file into a new part file, the names will only show up if you are not in timestamp mode. This method does not create individual component files (in your original post, it sounded like you wanted individual files). However, if this approach is acceptable, I might be able to write a secondary journal that would copy the "body" names to the corresponding "feature" names.

Which would you prefer? Open the parasolid file directly, component files are created and named; or import the parasolid and have multiple body features in a single file?

www.nxjournaling.com
 
Hi Cowski,

I saw the thread
thread561-316531: Parasolid Export Naming
and found it useful for my work. Is it possible for you to modify the vb code to rename the Body(0), Body(1) features instead of Timestamp bodies, with component names? If there are two bodies in a component, let it rename all bodies with the same component name.
 
Hi guys,
im a permanent follower od this tread, I have a (used) an other option with step to bring the right name to v5.
I have defined the step attributes PRDCT_ID and PRDCT_DESCRIPTION on nx part level to bring them to catia or any other cad system with step.
This discussed is an alternative way. Question to cowski can I automate to put (all) part attributes to the solid body on the model reference set?
Thanks in advance
 
Hey Cowski, I do not want individual component files because that is what we are starting with. I basically am trying to only have to upload one bulkfile part file into teamcenter with solid bodies that have the original component names that they were created from. This way we only have to maintain one file instead of 40. Our supplier has a lot of checks that each file must go through that take up a lot of time. Thanks.
 
Crowski, I guess i didn't answer your question "Which would you prefer? Open the parasolid file directly, component files are created and named; or import the parasolid and have multiple body features in a single file?" I would prefer import the parasolid and have multiple body features in a single file. Thanks.
 
Run the previous journal to name the solids and export them as a parasolid file. Run the code below after importing the parasolid to a new file to give the features the same name as the corresponding solid body.

Code:
Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen

Module Module1

	Sub Main()

		Dim theSession As Session = Session.GetSession()
		Dim workPart As Part = theSession.Parts.Work
		Dim lw As ListingWindow = theSession.ListingWindow
		lw.Open()

		Dim partBodies As New List(Of Body)

		'grab all the solid bodies
		For Each tempBody As Body In workPart.Bodies
			If tempBody.IsSolidBody Then
				partBodies.Add(tempBody)
			End If
		Next

		'if the solid body has a name,
		'get the parent feature and give the feature the same name
		For Each tempBody As Body In partBodies
			If tempBody.Name <> "" Then
				Dim parentFeatures() As Features.Feature
				parentFeatures = tempBody.GetFeatures
				'lw.WriteLine("body name: " & tempBody.Name)
				'lw.WriteLine("num parent features: " & parentFeatures.Length.ToString)
				'lw.WriteLine("")
				parentFeatures(0).SetName(tempBody.Name)

			End If
		Next

	End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

	End Function

End Module

www.nxjournaling.com
 
uwam2ie said:
Question to cowski can I automate to put (all) part attributes to the solid body on the model reference set?

Let me make sure I understand the question.
You want to take each part attribute and assign it to each solid body that is currently in the model reference set. Is this correct?

www.nxjournaling.com
 
Thanks Cowski! This does what i was looking for. Now hopefully our cutomers will like it. I am also interested in the assigning attributes from the the component files to the body like uwam2ie. Right now after i run the 2 journals i have to assign materials to all bodies. Would be if the material and gauge attribute came for the ride, but i'm not pushing it. What you've already done saves a ton of time.
 
Status
Not open for further replies.
Back
Top