×
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

NX3 Grip (Object Types)

NX3 Grip (Object Types)

NX3 Grip (Object Types)

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

RE: NX3 Grip (Object Types)

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

RE: NX3 Grip (Object Types)

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
http://www.sea4ug.com

RE: NX3 Grip (Object Types)

(OP)
Thank you for your answers.
(valuable, althought not very optimistic smile
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 smile 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)

RE: NX3 Grip (Object Types)

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

RE: NX3 Grip (Object Types)

Golab,
Check out the EDA &SUBTYP in the online docs...

Regards,
SS
CAD should pay for itself, shouldn't it?

RE: NX3 Grip (Object Types)

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 smile There are still area's of CAM that you can only program with GRIP.

Paul Phillips
Specialty Engineered Automation
http://www.sea4ug.com

RE: NX3 Grip (Object Types)

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

RE: NX3 Grip (Object Types)

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

   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:

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