Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to run automaticaly a GRIP program just after opened a part file ?

Status
Not open for further replies.

SuperQuark

Mechanical
Aug 8, 2010
10
Hi,

I would like to run automatically a GRIP program just after opened a part file.
What are the all the steps?

Is it possible to have a sample!

Thanks a lot
SuperQuark

 
Replies continue below

Recommended for you

What do you want your GRIP program to do to the opened part file?

You may be able to do it with UGMenu customization and put the action of running the GRIP program after the Open command.
Another method would be to usee a user exit and use your GRIP program to both open the file and run your customizations after the file is opened.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Hello Ben,

Thanks for your reply . . .
I need to open some part files and I would like that attributes defined in the part will be set by the GRIP program.
So, I just want to click on the prt file to open it, and the GRIP program must be stated automaticaly after it was displayed.
In this way each time I open the part file the attributes were updated . . .

Could you explain me how I could make it ?

Many thanks in advance.
SuperQuark
 
What version of NX are you running? Starting in NX 8.0 there is a way to define a so-called 'Attribute Catalog' which will automatically set-up Attributes that can then be added to your part files, either newly created ones or older ones which are being opened. Granted, you will still have to actually select the Attribute(s) to have to be permanent but at least the definition part can be automated.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Hi John,
At this time I work with NX6 . . .
Here some explanations that I really would like to make:

I want to extract strings from the drawing sheet attribute <W@$SH_PART_NAME>
Sample:
When I create a note with <W@$SH_PART_NAME>, the result is Cover_1234.prt
So I need 2 attributes (or expression) strings:

First one is : Title = Name ; Value = Cover
Second one is : Title = Number ; Value = 1234

How can I extract substring from <W@$SH_PART_NAME>?
Thanks
SuperQuark

 
The custom menu option with a AFTER value should work. John will have to confirm this.

Long_note = 'This is a long note'
sht_note = substr(long_note,11,9)

sht_note will be 'long note'

The substr command takes your string, the start position and # of charcaters and returns a portion of your string.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Ben,

I know the substr function in GRIP, but my question was how do you use it whith <W@$SH_PART_NAME> into NX as an attribute or as an expression ?
I don't find it, so it was for this reason that I thought to write a GRIP program.
I hope it is clear now . . .
Many thanks
SuperQuark
 
Those system attributes are newer than when I used NX last. From what I understand, that one onluy applies to the active sheet and changes with each active sheet in the drawing file. My guess is that you will need to cycle the sheets and grab the sheet name to your own attribute as they cycle.

What are you planning on doing with the sheet name attributes?


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Example : My part file name is COVER_1234.prt

I would like to extract the string COVER and the string 1234 and put them into attributes variables.
So, the result will be :
Attribute1 = COVER
Attribute2 = 1234

Then I will use it to fill in my drawing box . . .

TITLE = COVER (Attribute1)
NUMBER = 1234 (Attribute2)

SuperQuark

 
Use the system attribute for part name, &pname.

Search the string for the '-', then extract the beginning and assign it to the Sheet name attribute.
Uste the rest of the string for your partname attribute assigned in your format.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor