×
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

NX GRIP Print ENTITY data

NX GRIP Print ENTITY data

NX GRIP Print ENTITY data

(OP)
thread561-221594: printing value of an entity in grip

How do you print whatever is inside the entity?

print/myEntity(index) doesn't work

I am trying to debug a .grs program which calls several other .grs programs into memory.
One of the arguments passed into the .grs file that I am attempting to debug is myEntity.
There is a part in the program where a variable is set to a point/&spoint(myEntity(index))

I'd like to access whatever is being passed into the &spoint (start point) in order to make sure the correct data is in there.

Thank you!

RE: NX GRIP Print ENTITY data

Since that thread was never finished, not sure what that poster was looking for.

What are you looking for?
myEntity is an array, defined in the program code.
index is an entry into the array.
Depending on how the array is defined, that will get you the data type.
Index will get you the values from the array once you know the type and index value.

The array could be 1 dimensional, or 2 dimensional. 1 dimensional would be a single X, Y, Z point. 2 dimensional would be multiple points. in the same data statement.

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

Ben Loosli

RE: NX GRIP Print ENTITY data

(OP)
In my case, "index" is being declared as a number type, yet I don't see it being set to anything.

It is referenced several times in Program Loops where:

CODE -->

do/LOOP1:,index,1,total_index 

Anyways,

There is a line in .grs code that creates a point using an element from within the Entity array.

CODE -->

myPoint = point/&spoint(myEntity(index)) 

Can you help me write a block of code to output what is being passed into the point creation?

CODE -->

print/myEntity(index) 
doesn't work.

The Entity is defined as a tag_t object on the C++ side. It is passed into the .grs file as a grip argument.

When I print out myEntity(index) on the C++ side inside a loop (before it gets passed into the .grs file as a grip argument), it shows 5 numbers that increments by 1 at the end of each loop.

However, each time I run the program, those 5 numbers change in the sequence of looping operations.

For example the first 10 sets of 5 digit numbers in one instance of running the program will not match the second 10 sets of 5 digit numbers when I re-run the same program (the tag_t object is set to a NULL_TAG inside a For Loop, so I'm guessing it's collecting some kind of data that changes in memory)





RE: NX GRIP Print ENTITY data

Hi Miike110,

At the beginning of the GRIP subroutine/program add a declaration for an array of 3 numbers to accept the data from the startpoint (&spoint) information of entity "myEnitity". The array is named "N". Change the name if this causes conflicts.

CODE --> GRIP

ENTITY/myEntity(5)
Number/N(3) 

Replace the "print/myEntity(index)" with the following lines to display the 3 values that are extracted from the entity.

CODE --> GRIP

print/'Index = ' + istr(index)
print/'Type = ' + istr(&TYPE(myEntity(index)))
N=&SPOINT(myEntity(index))
print/fstr(N(1))
print/fstr(N(2))
print/fstr(N(3)) 

Hope this helps,

Joe

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! Already a Member? Login


Resources

eBook - Simulation-Driven Design with SOLIDWORKS
Simulation-driven design can reduce the time and cost of product development. In this engineering.com eBook, we’ll explore how SOLIDWORKS users can access simulation-driven design through the SOLIDWORKS Simulation suite of analysis tools. Download Now
eBook - Integrating the Engineering Ecosystem
Aras Innovator provides multiple options for integrating data between systems, depending on the scenario. Utilizing the right approach to meet specific business requirements is vital. These needs range from authoring tools, federating data from various and dissimilar databases, and triggering processes and workflows. Download Now
Research Report - Simulation-Driven Design for SOLIDWORKS Users
In this engineering.com research report, we discuss the rising role of simulation and the paradigm shift commonly called the democratization of simulation. In particular, we focus on how SOLIDWORKS users can take advantage of simulation-driven design through two analysis tools: SOLIDWORKS Simulation and 3DEXPERIENCE WORKS. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close