Assign Part Name To Attributes Using Grip
Assign Part Name To Attributes Using Grip
(OP)
What is the code for GRIP to recognize a part name and assign it to the part attributes. The file name is GE81001234.prt. I want the attributes to read Title = Part Name and the Value = 81001234 with no "GE" attached.
Larry Leonard
Designer
Smith-Nephew Orthopaedics





RE: Assign Part Name To Attributes Using Grip
assatt/part,'PARTNAME',substr(&partname,3,10)
It's all spelled out in the GRIP manuals.
"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.
Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
RE: Assign Part Name To Attributes Using Grip
Have not been able to put my hands on the GRIP manuals.
I have been looking to get assistance from our support people but decided to go on my own.
Trying to pick up as much as I can from the HELP files.
If you can help me further I would greatly appreciate it.
Larry Leonard
Designer
Smith-Nephew Orthopaedics
RE: Assign Part Name To Attributes Using Grip
"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.
Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
RE: Assign Part Name To Attributes Using Grip
ASATT/PART,'PartName',SUBSTR(&PNAME,3,10)
HALT
Ben is right in that the help files are a good place to get this from, but sometimes you need a nudge in the right direction. Since this is such a short program I'll explain what is going on.
ASATT/ - this is the key word used to assign attributes
PART - minor word that tells it to assign the attribute to the part rather than an individual entity
'PartName' - this will be the title of your attribute
SUBSTR(&PNAME,3,10) - this will be the value of your attribute, it has 2 parts so let's break it down further
&PNAME - this grip statement will return the current part name, in our case it would be GE81001234.prt
SUBSTR - this is the keyword to extract part of a string. The syntax is SUBSTR('string',<start>,<end>)
So, SUBSTR(&PNAME,3,10) tells it to extract characters 3-10 of the part name (in this case 81001234).
SUBSTR(&PNAME,3,10) will work as long as there are always 2 characters at the beginning that you don't need and you always want the next 8 characters. If the part name lengths are variable then the grip program gets more complicated.
RE: Assign Part Name To Attributes Using Grip
2 - How hard would it be to have the TITLE: DESCRIPTION filled in automatically and then have a screen ask for a user entry for the VALUE:__________. (Just less trying for the user)
Larry Leonard
Designer
Smith-Nephew Orthopaedics
RE: Assign Part Name To Attributes Using Grip
You could do it with a macro/NX3 journal.
GRIP can also ask for a value and then assign the attribute.
"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.
Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
RE: Assign Part Name To Attributes Using Grip
How do I combine the code:
assatt/part,'P/N',substr(&partname,3,10)
Title: P/N Value: 81001234
popup on the screen will ask the user to input info
Title: DESCRIPTION Value: user input.
Title: MATERIAL Value: ALUMINUM
Title: FINISH Value: ANODIZE
Larry Leonard
Designer
Smith-Nephew Orthopaedics
RE: Assign Part Name To Attributes Using Grip
Text/'Enter Value:',valvar1
assatt/part,'title',valvar1
It can get a lot more complicated with error trapping and good value checks.
"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.
Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand