Macro help - to assign part attributes (NX 7.5)
Macro help - to assign part attributes (NX 7.5)
(OP)
Hi guys,
I've been looking (with no success) to get a macro in NX 7.5 to open up the attributes dialogue (Format > Database Attributes > Assign), assign all of the mandatory attributes set values (the first is a string input but the rest are all chosen from drop-down lists) then hit OK. This is because our company requires these attributes to be filled in order to save a part for the first time, but for many parts this is completely unnecessary (damn beaurocracy!) and therefore very time consuming when making lots of parts.
The problem I'm having is that when recording a macro and inspecting it, it doesn't seem to recognise me choosing the next attribute, and so keeps trying to modify the first one (the ITEM POSITION number is always the same). This leads to an error when it tries to use a list index higher than the first option allows (the first attribute has 3 options, later ones have many more), as well as obviously not being able to modify any attributes apart from the first.
I find the macro language quite confusing and the help file next to useless so any general macro help is very welcome too!
Or if anyone can think of accomplishing this task in any other way.
Cheers
I've been looking (with no success) to get a macro in NX 7.5 to open up the attributes dialogue (Format > Database Attributes > Assign), assign all of the mandatory attributes set values (the first is a string input but the rest are all chosen from drop-down lists) then hit OK. This is because our company requires these attributes to be filled in order to save a part for the first time, but for many parts this is completely unnecessary (damn beaurocracy!) and therefore very time consuming when making lots of parts.
The problem I'm having is that when recording a macro and inspecting it, it doesn't seem to recognise me choosing the next attribute, and so keeps trying to modify the first one (the ITEM POSITION number is always the same). This leads to an error when it tries to use a list index higher than the first option allows (the first attribute has 3 options, later ones have many more), as well as obviously not being able to modify any attributes apart from the first.
I find the macro language quite confusing and the help file next to useless so any general macro help is very welcome too!
Or if anyone can think of accomplishing this task in any other way.
Cheers





RE: Macro help - to assign part attributes (NX 7.5)
I'd use a journal.
But then I'm probably a bit biased...
www.nxjournaling.com
RE: Macro help - to assign part attributes (NX 7.5)
RE: Macro help - to assign part attributes (NX 7.5)
thread561-221511: Journal file to write part attribute
thread561-209171: Adding attributes to a file using journaling?
thread561-349259: Journal Read Attribute
thread561-329148: NX - have the file name as a part attribute or string expression
thread561-332871: Journal - Show Attribute Value on TextBox (User Form)
thread561-354024: journal help
www.nxjournaling.com
RE: Macro help - to assign part attributes (NX 7.5)
You can try this BlockStyler journal - prepared to automate attribute setting.
1. Attached dlx and xltx files must be placed in C:\temp for this example.
2. The dlx is a dialog file
3. The xltx is an Excel template file
4. The vb is the journal to run.
5. Try run the journal within a active NX part,
it's not neccesary to use the first button in the dialog , it's only for test when writing the journal.
But if the button is activated ,DONT close the Excel application manually. The Excel is closed by journal at "OK" or "Cancel"
6. Depending your setting's in NX , maybe it will be neccesary to use the NX "reset" button to clear the dialog fields,but have in mind,
if the attribute is set once the dialog fields will inherite the value from the part-attribute ,but of cource it can be ovewritten with a new value.
7. see attached pdf also.
lklo
RE: Macro help - to assign part attributes (NX 7.5)
SCRIPT_INVOKE
System.Runtime.InteropServices.ExternalException: Cannot execute a program. The command being executed... etc (it's quite long and I can't copy the text)
This happens when i journal in vb or C#, I'm not sure if maybe my company PC is blocked from running certain things that may allow this to function?
Thanks for the help!
RE: Macro help - to assign part attributes (NX 7.5)
(bump)
RE: Macro help - to assign part attributes (NX 7.5)
RE: Macro help - to assign part attributes (NX 7.5)
www.nxjournaling.com
RE: Macro help - to assign part attributes (NX 7.5)
RE: Macro help - to assign part attributes (NX 7.5)
RE: Macro help - to assign part attributes (NX 7.5)
If you have a webkey, you can log an incident through the NX menu: Help -> Online technical support -> Log an incident with technical support...
Fill out the form and give them as much detail as you can, including full text of the error message, OS version, NX version, computer specs, etc etc.
www.nxjournaling.com
RE: Macro help - to assign part attributes (NX 7.5)