Cancel
Showing results for 
Search instead for 
Did you mean: 

NX Drafting Customization

Pioneer
Pioneer

I have a programming/customization idea that I would like to implement but don't quite know where to get started in NX with SNAP.  Primarily since I am completely new to SNAP and it may possibly not be the right programming tool for what I want to do.  Hopefully someone could point me in the right direction.

 

A action that I constantly perform in my assembly drafting file is link a note to a component attribute which is a string called NAME. The keystrokes/mouse clicks can become combersome in NX when doing this several times consecutively.  

 

What I would want to do is create a dialog/command would allow me to initiate a command where I input the attribute name that I want NX to look for and only use my mouse from that point on to click on components and position my notes.  Basically mimicing keystroke with static settings for the attribute name and selection filter.

 

Please see the attached keystroke video if my description seems too open to interpretation.

 

Mark

14 REPLIES

Re: NX Drafting Customization

Valued Contributor
Valued Contributor

SNAP would not be the right tool for this since it doesn't enable you to customize the drafting application.  SNAP is currently limited to Modeling.

 

You would be able to achieve this using NX Open customization.  You would need a dialog with a Specify Location block and a Specify object block.  From the selection of the specified object, you would extract the NAME attribute value, and then create a drafting note at the specified location.  For example, you would need this builder class:

 

NXOpen.Annotations.DraftingNoteBuilder draftingNoteBuilder;

 

and set

 

draftingNoteBuilder.Text.TextBlock.AddAttributeReference(component, "NAME", false, 1, 1);

 

to create your note.

 

You can record a journal of your operations using Tools->Journal->Record... and then perform the exact same operation you provided in your AVI.  This will give you an idea of what you need to program.

Re: NX Drafting Customization

Pioneer
Pioneer

Thanks for that tip, you saved me alot of time headed in the wrong direction.  I was planning on experimention with minisnap, but obviously that is not applicable in this scenario.

 

Does anyone know if NX Open has a type of experimantal interface like minisnap for learning? 

Re: NX Drafting Customization

Valued Contributor
Valued Contributor

The journaling interface would be your best laboratory to experiment. You can record a journal in the language of your choice, but if you choose C# or VB, you will be able to playback the journal. Nothing prevents you from modifying the journal so you can fiddle around and try as many things as you like.

In your case, I would first try to create a journal that will select a predefined object and add the NAME note at a fixed position.

 

Re: NX Drafting Customization

Pioneer
Pioneer

I noticed several different programming languages available for journal recording.  Are any programming languages any more or less capable of recording NX commands then others?  

 

Also, would you be interested in providing me this type of NX custom interface.  Seems like you more than know your stuff and we do not currently have a author license for NX Open.  Are you able to privately email me to provide a rate if you are interested?

Re: NX Drafting Customization

Valued Contributor
Valued Contributor

All supported languages are equally capable when it comes to record NX commands.  Only C# and VB may be played back.

 

The main question would be:  do you use NX on a different platform than Microsoft Windows?

No means go for C# (or VB if you can tolerate it) and use the .NET NX Open package, which is less expensive.

Yes means go for C++ or Java.  It is more expensive but is the only solution if you run NX under Linux (or MacOS in a near future).

Re: NX Drafting Customization

Legend
Legend

Let me know what version of NX you are using and I will make available a journal that would allow you to do the following.

 

1.  You would be asked to select a component

2.  The journal would find the the required attribute value

3.  The journal would then ask for a location for the note and create the note.

4.  If required loop to do further notes for other component/attribute/notes.

 

Is this what you are looking for?

 

Frank Swinkels

Re: NX Drafting Customization

Siemens Phenom Siemens Phenom
Siemens Phenom

> SNAP is currently limited to modeling

 

That's almost true. But actually SNAP does have functions for creating notes, and it's pretty good with assemblies, so it might work here. But experimenting with MiniSnap wouldn't work because it doesn't include the Note function.

山田
yamada

Re: NX Drafting Customization

Pioneer
Pioneer
I use NX9.0.2 currently. Also I was just curious as to wether journaling differs greatly between versions 8, 8.5 and 9?

Thanks for you help, would be a great starting point.

Sent from my iPhone

Re: NX Drafting Customization

Siemens Phenom Siemens Phenom
Siemens Phenom

While the API may change from release to release, the journaling mechanism remains fundamentally unchanged. As capability is added to NX, associated API functionality is also added and will be written to a Journal that is recorded while accessing that functionality interactively.

 

The only major change is the introduction of Python as an alternative language in NX 9.0.1

 

Regards,

Jim