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!

How To Extract Cylinder Feature Data

Status
Not open for further replies.

Vann

Automotive
Jan 27, 2004
8
I am trying to extract information from selected cylinders in a model and get the following information for each:
Point of origin
Diameter of Cylinder
Direction
Height of Cylinder

My process is as follows:
1. Prompt the user with a "MESSG" to select cylinders for data extraction.
2. "MASK" the entity selection for Solid (70) only.
3. Use the "IDENT" function to store the cylinder data into an array
4. Loop through the array.
5. Extract the "ORIGIN XYZ", Direction, Diameter and Height
6. Write this data to a text file

I have a handle on everything except for step # 5.

I can find all of this information by using the "Feature Browser" on the "Information" menu in UG Modelling but cannot seem to find the GRIP functions that provide access to this data.

If anyone can point me in the right direction. I would sure appreciate it.

Thanks a lot
 
Replies continue below

Recommended for you

The GRIP manual should give the information as to how the array is formatted with the information you are looking for.


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

Ben Loosli
Sr IS Technologist
L-3 Communications
 
Okay, I looked in my GRIP manual and it canot be done directly. GRIP doesn't know too much about solid bodies beyond their existance and mass properties.

There are some other methods that can be used to get the information you need. Create circles on the top and bottom face edges and obtain the diameter, center of one end and claculated height from these. I don't know what value the direction is to your program, but a vector could be constructed between the center points.

If you really want to obtain information from solid bodies, you will need to upgrade your programming skills to UG/Open API programming or the newer .net journalling.


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

Ben Loosli
Sr IS Technologist
L-3 Communications
 
Thanks looslib,

I've been searching all over the manual trying to find out how to get the info.
This is my first GRIP program so I was hoping there would be a straight forward way to get this data.I've learned a lot of other things about the GRIP language in the process of searching though.

I need the direction because I can use the origin XYZ coordinate and the direction to determine where the end of my cylinder needs to be based on it's height.
These are parameters that get passed to another program via a text file in the following format:
CYL = X1,Y1,Z1,X2,Y2,Z2,DIA1,DIA2.
I know that if my cylinder's X origin is 0 and it is in +X direction, 2" high, then my X2 must equal 2. Some models have multiple cylinders in different directions but they are mainly straight so in this case Y1 will equal Y2 and Z1 will equal Z2.

We are just in the process of upgrading to NX3 so I will look into the journaling.

Thanks again for the reply. I really appreciate your input
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor