Engineer Meet NX Journaling

Journal is a powerful tool in NX/Unigraphics that allows common Engineering routines to be automated. This website is being designed for the Engineer with a modicum of programming knowledge who desires to create journals in NX/Unigraphics. We will rely predominately on the coding learned from Visual Basic to create our journals. If you are a complete novice to programming, you may find it best to grab an easy Visual Basic(VB) book from your local library and familiarize yourself with the basics code writing before attempting to create your own journals. Others will jump right in copying the portions of codes they need to create their own journals, without necessarily knowing the formal coding.

We welcome you each to the website and hope you learn more about Journaling with NX.  Be sure to sign up for the RSS feed to keep up to date on new postings and come back to share with us the journals you end up creating.

Comments

I have a very basic problem, hope you can help me..
When I try to run a journal, I get " Invalid attempt to load library" error
this happens even I try to run a sample journal of NX.
what should I do?

thanks in advance

ilkea.

- sorry, "forum" section is not active, thus I post this message here -

That depends on which NX version you are using.
If you use till NX 7.5 you execute/ build the application in .NET 3.5.
After that you need .NET 4.0

Regards,
Pradeep Kumar Arunachalam

I have solved the problem. .NET 4 must be installed..
sorry for the inconvenience..

Can we save the file in folder by using Propagate directory in NXUG.

Ex:- http://catiaassemblytutor.blogspot.in/2008/03/save-management.html

I'm not familiar with Catia, but from the link provided, it sounds like the NX "clone" function would provide similar functionality. A clone operation allows you to perform a "save-as" on an entire assembly; you can specify an output directory for all the files. The clone command interface is not what I'd call "user friendly", you will want to read the NX help files and play around with it a bit to see what it can do. The clone command can be found at Menu -> assemblies -> cloning; from here you can edit or clone an existing assembly.

Someone wrote a user program years ago called "UGZip" that would copy an assembly and all of its component files to a .zip file. If interested, you might find a copy on one of the NX forums.

NX also provides some command line interface (CLI) programs that you can use to edit assemblies. Look up the "ugpc.exe" and "ug_edit_part_names.exe" in the help files. These CLI programs are "scriptable", meaning that you can call them from your own journals or programs.

If I go through clone option I have to rename or else can I can keep the same existing file name.My requirement is to propagate the all parts to the new folder.

Probably the easiest answer is to use the UGZip program to send them to a zip file then unpack the zip file to the desired folder. Here is a link to a forum thread about UGZip:
http://www.eng-tips.com/viewthread.cfm?qid=371333

If you do not want to use UGZip:
Do you need to make copies of the part files or do you just need to move the existing files to a new folder? If you are just moving files, I would suggest the "ugpc" and "ug_edit_part_names" utilities.

One old cloning trick (not sure if it still works in the newer versions of NX) was to specify a suffix and enter a single space character for the suffix. The clone operation would run, but would not actually add the suffix resulting in copies of the parts with the same names as the originals.

Thank you,
I will check and let you know.

I need help to create a journal which will help me to delete annotation at particular place. E.g. In the title block I have Rev A details row.
I would like to delete those details through macro. Please guide.

I wrote some similar code a while back to find the note on the title block for the title of the drawing. The approach I took was to use two Point3d objects to define the corners of an imaginary rectangular "zone" on the drawing. The code then iterated through the note collection looking for notes where the .AnnotationOrigin was contained within this zone.

The relevant code snippet is shown below:

Dim titleLowLeft As Point3d
Dim titleUpRight As Point3d

'assign values for titleLowLeft and titleUpRight to define a rectangular area on your drawing sheet

'The code below will iterate through the note objects and find those where the note's .AnnotationOrigin
'is contained within the defined rectangle.

For Each tempNote As Annotations.Note In workPart.Notes

'test to see if the note is in the title block "drawing title" box
If tempNote.AnnotationOrigin.X < titleLowLeft.X Then
'note origin is outside the box, skip it
Continue For
End If

If tempNote.AnnotationOrigin.Y < titleLowLeft.Y Then
'note origin is outside the box, skip it
Continue For
End If

If tempNote.AnnotationOrigin.X > titleUpRight.X Then
'note origin is outside the box, skip it
Continue For
End If

If tempNote.AnnotationOrigin.Y > titleUpRight.Y Then
'note origin is outside the box, skip it
Continue For
End If

'if we get here, the note is in the box
Dim noteText() As String = tempNote.GetText
For Each Line As String In noteText
lw.WriteLine(Line)
Next

Next

Thank you for your help. It will work.

Any journal or macro for misalignment.

I am looking for a journal that will change all non rapid traversal feed rates to a new value. it will change all the paths in the program group or all selected paths. Is there anything like that our there?

I have made some progress on the traversal feed rate journal but I could use a little help.
I am working on a journal that updates the Traversal feed rate on operations within a program. I would like to get the Traversal feed rate value and unit for a given NXOpen.CAM.Operation. I see the function CAMObject.GetFeedRate, but I do not understand the parameters. The first parameter is a string, "the name of the parameter index". Should this be "Traversal"? The second parameter is a double value. I do not understand this parameter.

There are usually other methods such as "Get number of parameters" and "Get parameter by number" that will let you loop through all the available parameters. If these exist for the object of interest, you could write a small journal that lists all the parameters and you can use what you learn in your main journal.

If you email your current code and an example CAM file (one that has at least one object you are interested in), I can take a look. I have not done much programming on the CAM side of things (and I'm not entirely sure that I have access to a CAM license right now), but I might be able to take a look.

info@nxjournaling.com

Thank you

I have this program running perfectly and I will share the code once I make a small change listed below.
when I run the journal I have to cut and paste the name of the program group. I would like to run the journal and click on the program group I want to use instead of the cut and paste,

any help would be appreciated,

thank you

How do I move a thread to a different topic?
hi all :)