Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX3 Grip (Object Types) 1

Status
Not open for further replies.

golab

Mechanical
Nov 3, 2006
4
Hi everyone!
Here are some issues I've come across when I was trying to create my first Grip code.
My idea was to create a .grx that will automatically put all UG objects to the layers where they should end up (datums->61, sketches->21 etc.), no matter if they are on a selectable layer at the moment or not.
And here are the questions:
1.Which object type number is assigned to the Sheet Body?
(I use MASK/ statement and don't want to make Solid Body
selectable as well-ONLY sheets)
2.When I put all the "134-SKETCH" objects to the particular
layer there is still something left. I gather that sketch
contains some more objects apart from "134-SKETCH".
What are these objects?

Thanks in advance and best regards

mateusz (matthew)
 
Replies continue below

Recommended for you

I doubt you will be able to do all of this with GRIP.
GRIP is a dead language and has not been enhanced since V10, except for the plotter routines in NX3. Most of the entities associated with a sketch do not show up in a layer listing, they are just there. Since Sketches are new to V10, the MASK/ may not have been fully updated to isolate all subtypes of sketch entities.
There should be a subtype mask for sheets versus solid bodies.


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

Ben Loosli
Sr IS Technologist
L-3 Communications
 
Working with Solids and Sheet Bodies in GRIP can be tricky. You may need to consider the SubType option. Although, even then you may not be able to do everything you need.

Not done anything with Sketches ... does using the "Member" qualifier help ?

Paul Phillips
Specialty Engineered Automation
 
Thank you for your answers.
(valuable, althought not very optimistic :)
I'll spend some more hours on it and if I come up with a way to do it I'll post it.

looslib wrote:"GRIP is a dead language "
As I wrote I'm a rookie :) I work as a designer. I'm not in charge of customizations etc. I treat it only as my hobby.
I find it very useful to write codes that can do some sequential operations in NX for me, but if you think that Grip isn't the best way to do it, just let me know what you would advise.
(I know C but haven't been using it since university)


philipd wrote: "You may need to consider the SubType option."
How can I use the SubType number in the MASK/ statement?
And what is the "Member" qualifier help?

Thanks again and best regards

mateusz (matthew)
 
Journaling, NXOpen is what you will probably want to check out. Grip is dead, but still pretty useful.

See if you can get the other two working for you.

Justin Ackley
Designer
jackley@gmail.com
 
Golab,
Check out the EDA &SUBTYP in the online docs...

Regards,
SS
CAD should pay for itself, shouldn't it?
 
Matthew, this may or may not help, it's a section of code that sets the color of the solid object based on its type, i.e. solid, or sheet ...

Ifthen/ ((Etyp == 70) or (Etyp > 15 and Etyp < 24) or Etyp== 43) or (Etyp == 65) or (Etyp == 66)) and (Styp == 0)
Obtain/ Ents(J),Btyp
If/ Btyp == 1, &Color(Ents(J))=7 $$ Solid Body
If/ Btyp == 2, &Color(Ents(J))=6 $$ Sheet Body
Endif

Ents(J) is the array of all the selected objects. You should be able to simply replace &Color(Ents(J)) =, with &Layer(Ents(J)) =

I'd wouldn't go as far to say that GRIP is dead, more so on life support :) There are still area's of CAM that you can only program with GRIP.

Paul Phillips
Specialty Engineered Automation
 
Life Support says there may be some chance of resuscitation.

Maybe GRIP is in the Hospice waiting for the end to happen.


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

Ben Loosli
Sr IS Technologist
L-3 Communications
 
OBTAIN/ statement is what I was looking for. It works good now. (thank you phillpd)
I've also checked EDA &SUBTYP but it has one value for both solids and sheets so, at first glance it seems to be useless. Since Obtain/ solves the problem I didn't check it thoroughly.
Anyway, I want to sincerely thank all of you for your support and valuable pieces of advice.

Thanks again and best regards

mateusz (matthew)


PS. here's a piece of code. Of course I'll a appreciate any comments on this (excluding criticism:)).

CL3:
IF/resp2array(3)==0,JUMP/END:
INEXTE/WORK
MASK/70
$$
i=1
GET3:
michael_jordan(i)=NEXTE/IFEND,EOGET3:
i=i+1
JUMP/GET3:
EOGET3:
$$
j=1
PUT3:
OBTAIN/michael_jordan(j),Btype
IF/Btype==2, &LAYER(michael_jordan(j))=81
j=j+1
IF/j==i,JUMP/EOPUT3:
JUMP/PUT3:
EOPUT3:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor