Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX Journal Hole Depth & Thru Holes

Status
Not open for further replies.

cmick31

Mechanical
Jun 1, 2021
19
0
0
US
Evening,

I have a Journal that applies attributes to all cylindrical faces in a body according to their hole sizes(reads radius).

Using AskBoundingBoxExact I'm able to grab the depth of holes. However, one thing I can't seem to figure out is how I would determine if the cylindrical face runs all the way through its associated body.

Basically what I'm trying to do is say in simple terms; if face radius 3.4 is 16 deep, make attribute "M8 16 Deep", or if face radius 3.4 runs through entire solid body, make attribute "M8".

One thing I could run into(regarding example above) is if the body is "16 thick" I would also need to find a way to determine its through the body and not apply the depth.

Any thoughts or answers on how I can achieve this?

Much appreciated for any guidance.

 
Replies continue below

Recommended for you

Are you working with a fully featured model or a dumb body?

For a featured model, you can get the faces created by the hole command.
For a dumb body, assuming you have a reference to the cylindrical hole face, one approach would be to use .AskAdjacFaces to find the adjacent faces to the cylindrical face and inspect them. If you find a conical or planar face with one edge that is the same radius as your cylindrical face, you found the bottom of the hole. I might have some code that does something similar.

www.nxjournaling.com
 
Thanks for the quick reply Cowski I very much appreciate it!

I am using dumb body. AskAdjacFaces could very well do the trick, I'm going to dig in to it.. To my understanding I could write something along the lines of:

If found adjacent planar/conical face then
grab depth of hole & apply to attribute.
Else if no face found then
skip depth found & apply attribute.

If you wouldn't mind, could you provide the code you were talking about? I think it'd be beneficial to me rather I use it or not. I've been self teaching for a couple months and a lot of your work on here has been the material I study.



 
The journal code can be found here.
Open the desired part in NX and run the journal code. It will prompt you to select a face (selection will be limited to an internal cylindrical face); it will then report the number of related faces and highlight them all. I added the highlighting for a quick visual check; unfortunately, the highlighting stays longer than needed. You will probably have to use part cleanup -> remove extraneous highlighting to get rid of it. I don't recommend highlighting faces in this way for your final code.

www.nxjournaling.com
 
Cowski,

Perhaps you could give some of your expertise..

My program seems to work pretty well except on Counterbores.

The way I have it ran is, select cylindrical face - Ask adjacent faces - if both adjacent faces are bounded plane then don't attribute as counterbore

If one of the adjacent faces are cylindrical then attribute as counterbore.. However when I tested the adjacent faces output the counterbore face seems to read out as value of 22 (Bounded Plane value). It surprised me because I thought it'd read out as cylindrical, but thinking about it the bottom of a counterbore is a flat face..

Do you have any thought on how I could program it to grab/find the counterbore cylindrical face to determine attribute read out? I can provide my code if it'd help you.

Thanks
 
Status
Not open for further replies.
Back
Top