×
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

Research Report - How Engineers are Using Remote Access
Remote access enables engineers to work from anywhere provided they have an internet connection. We surveyed our audience of engineers, designers and product managers to learn how they use remote access within their organizations. We wanted to know which industries have adopted remote access, which software they are using, and what features matter most. Download Now
eBook - Managing the Context of Product Complexity Using the Digital Twin
Keeping track of changes to complex products is difficult—think Aerospace & Defense equipment, new generations of commercial aircraft, and software-based automobiles. A new way to managing the digital context of the physical product is required and the answer is the Digital Twin. This ebook explores the opportunity available for Operations and Maintenance for the Digital Twin. Download Now
White Paper - Trends in Industrial Filtration
Substantial progress has been made in filtration technologies in recent years. New filter media materials, designs and processes have led to filters that are more efficient, reliable, compact and longer lasting. This white paper will discuss the various trends that are impacting operational responsibilities of MROs today and the resources that are available for staying up-to-date on the latest filtration solutions. 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