×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

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

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

(OP)
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

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

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.

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

(OP)
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

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

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

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

(OP)
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

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

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

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

(OP)
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

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

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources