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!

Journal (.NET) Remove Parameters Command

Status
Not open for further replies.

MSPBenson

Mechanical
Jan 13, 2005
190
0
0
GB
Folks,

It's a long shot as I can't find any documentation for this in the help docs.
Anyone know of a nx open command to remove parameters in ug.
I've tried recording a journal but this is un-supported.
The only thing I can think of is that they've called it something else in the docs.
Any help would be great.

Cheers,


Mark Benson
Aerodynamic Model Designer
 
Replies continue below

Recommended for you

Sample NXOpen .NET Visual Basic program to remove parameters from all bodies in work part

Option Strict Off

Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities

Module remove_parameters_from_all_bodies_in_work_part

Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()

Sub Main()

Dim workPart As Part = s.Parts.Work
Dim myBodies As NXOpen.BodyCollection = workPart.Bodies
Dim bodytag(0) As NXOpen.Tag
Dim a_body As Body

For Each a_body In myBodies
bodytag(0) = a_body.Tag
ufs.Modl.DeleteObjectParms(bodytag)
Next

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
End Function

End Module
 
Tonie,

You're a star and you get one for your efforts.

Not quite what I wanted but lead me to this:

UF_MODL_delete_object_parms

Which will work on sheets and curves.

I really hope that one day soon they add the GUI command name to the help for nx open. It would make everyones life so much easier. Search is great but only on the slightest off chance you actually know the random name they've called stuff. Ho hum.

Thank you once again Tonie



Mark Benson
Aerodynamic Model Designer
 
vitulakk,


-----------------------------------------
dim part_name as string = "xxx_name"
dim stringlen as part_name.length()
Dim i As integer= part_name.LastIndexOf("_") ' position of the last "_"
Dim partnumber As String = part_name.Substring(0,stringlen-i
-----------------------------------------------
That should return "xxx" but I've not tested it.
Do a search in google on string.substring to get documentation if you need more info.

It might be a good Idea to copy this question into a new thread so other people can find it in the future.

Mark Benson
Aerodynamic Model Designer
 
If you want to remove parameters, would exporting a parasolid work?

You may be able to make a macro that would export the chosen object(s), delete them from the file, and import the parasolids in to replace them. It probably would not work for curves, but should for sheets and solids.

Disclaimer: I don't have a version of NX with journaling to test on.
 
As always, everything is in, but either difficult to get the key word to search for or not f*****g supported !

That's the price to pay for a product sponsored by share-holders. The sooner the better ...

 
Tonie,

Can you not post without including a jab at UGS every time?

Tim Flater
Senior Designer
Enkei America, Inc.

Some people are like slinkies....they don't really have a purpose, but they still bring a smile to your face when you push them down the stairs.
 
Vitulaaak,

Sorry the line "dim stringlen as part_name.length()"

should be

"dim stringlen as integer = part_name.length()"

Mark Benson
Aerodynamic Model Designer
 
Status
Not open for further replies.
Back
Top