Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Macro help - to assign part attributes (NX 7.5)

Status
Not open for further replies.

Alexbabcock

Mechanical
Nov 8, 2013
12
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
 
Replies continue below

Recommended for you

I second that. They can be recorded as well as macros.
 
If you go the journal route, a search on this forum will turn up several threads that may interest you, here are a few to start:

thread561-221511
thread561-209171
thread561-349259
thread561-329148
thread561-332871
thread561-354024

www.nxjournaling.com
 
hi

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
 
 http://files.engineering.com/getfile.aspx?folder=374b2eb8-2295-4274-95bb-1f88b96e4309&file=attribute_set_automate.zipx
Ah, I should have mentioned I don't seem to be able to use Journal in any way - when I try and run recorded actions, it gives me the error:

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!
 
My last post was intended as a hypothetical:
If I were you, I'd contact GTAC with the error message and see what they say.

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
 
Ah i'm sorry, completely read that as 'I'll contact... at the time thought it was odd you'd do it, but then thought you were one of the UG guys that are about on these forums!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor