×
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

NX9 - VB Code possible for this?

NX9 - VB Code possible for this?

NX9 - VB Code possible for this?

(OP)
When doing a measure bodies, the result always pops up on VOLUME. Is it possible to create a Journal that extracts that Volume result?

What I would like to do, which may be beyond my abilities, is create a journal that will allow me to select a solid body or multiple bodies, and when I click OK, will prompt me for what mass I want the bodies to be, then it will multiply the mass I entered by 1000, find the volume of the selected bodies and divide that by 1000, then divide the converted mass by the converted volume and multiply the answer by .0361273 and give that density to the solids I had selected.

The equation is simply Density=((mass*1000)/(volume/1000))*.0361273

I will likely be asking help to make the VB to do this, but first I am wondering if it is even possible to automatically extract the volume of the bodies to begin with.

RE: NX9 - VB Code possible for this?

Hi Kenja824

What are you really trying to do?

I'm asking this because it seems that you're lost with software/part units.

In NX, density is a material (part) property and do not need to be calculated, but setted instead, so the software can automatically calculate the mass and weight for you based on the solid volume. You set it on Tools -> Materials -> Assign Materials.

With your formula you are simply converting the already specifyed density from lb/in3 to g/cm3. I'm assuming it by the constant 0.0361273 that you're multiplying by.

Cheers.



RE: NX9 - VB Code possible for this?

(OP)

Hi andradrr

I deal with the company's library of components a lot and sometimes I get parasolids of components from other companies to add to the library. Sometimes our modelers will model up a standard component I add to the library and quite often I will work with Family Parts where I have multiple solid bodies for a family of components. The problem is it is rare that a component has all of the inside workings modeled up as well. A hydraulic cylinder will be modeled as a solid body with a shaft and clevis coming from it. The point is, if I just give them a steel material, the weight will come out far heavier than the component should be. So I need to change the density so that it will have the correct weight when we do a measure bodies.

I used to spend a lot of time doing this on a family part with multiple bodies. I would have to give the bodies a density, measure bodies, change the density, measure bodies, change the density and so on until I got the weight correct.

Cowski saved me a ton of time now by teaching me the equation of Mass/Volume=Density. So now I can do a measure bodies to get the volume and find the density I need rather than playing with it.

But my inner lazy instincts took that and thought, I wonder if I can make a journal to do all of this for me then. So now I am digging into trying to create a button that will just let me type in the mass I want and select the bodies I need to change and presto, they get the density assigned and now weigh the correct amount.

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