×
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

Code returns wrong reference set and volume...

Code returns wrong reference set and volume...

Code returns wrong reference set and volume...

(OP)
I have a strange problem. I am currently using component.ReferenceSet to return the reference set of model parts in an assembly.

However in a particular model part, it returns the wrong reference set and number of solid bodies in the set.
It should return the MODEL ref set, however it is returning the Entire Part ref set, as well as 2 solid bodies instead of what should be 1.

I am also running Measure Bodies to calculate the volume. The volume is correct for every part in the assembly except this one part. The volume should be 1.38 cu. ft.. However my code produces 41 cu. ft.

So I tried using some different code to get the ref set, I used: refSetName.

It produced a different result, but still the wrong one. It said that the ref set was "NONE" and that there was still 2 solid bodies in the ref set.

If you like you can see the portion of my code that looks for the ref set below.

My hunch is that this particular part was made using Trim Bodies, and because of that it is also calculating the volume of the part that it is connected to. That still does not explain the ref set problem. However even then I am not sure, because if that were true, in NX there would be more than 1 solid body in the ref set.

theUfSession.Assem.AskComponentData(temp.Component​.Tag, partName, refSetName, instanceName, origin, csysMatrix, transform)

objExcel.cells(row, 13) = temp.Component.ReferenceSet

or

objExcel.cells(row, 13) = refSetName

Both produce different results...

RE: Code returns wrong reference set and volume...

Are you sure that the part in question has a "MODEL" reference set defined and it is in use in the assembly? Is this the only part that shows this behavior?

To test your "trim body" theory, have you created a new part that uses trim body features to see if it gives the same type of error when used in the assembly?

www.nxjournaling.com

RE: Code returns wrong reference set and volume...

(OP)
Yes, in every other instance where a model uses trim bodies, the correct volume and reference set are returned. The part in question is in-fact part of the assembly, and it does have a "MODEL" reference set defined. This is the only part that I found that gives me a problem. There are no others parts in the assembly that return erroneous data. It is strange really.

RE: Code returns wrong reference set and volume...

Quote (junfanbl)

The part in question is in-fact part of the assembly, and it does have a "MODEL" reference set defined.

Do you mean the solid body is modeled in the assembly file?

www.nxjournaling.com

RE: Code returns wrong reference set and volume...

(OP)
You know what, I am using a TC/NX setup so I do not work directly with NX model files. Is there a way for me to check?

RE: Code returns wrong reference set and volume...

When you open the assembly file, is the solid body in question the result of operations in the part navigator; or is the body modeled in a separate file and added as a component?

www.nxjournaling.com

RE: Code returns wrong reference set and volume...

(OP)
Okay, when I open the assembly file through TC I can't actually see how the part was designed in the part navigator unless I make that specific part the displayed part. So my guess is that this part was modeled separately and added as a component.

RE: Code returns wrong reference set and volume...

If you open the part file by itself and use "measure body" on the solid, does it give the correct result?

www.nxjournaling.com

RE: Code returns wrong reference set and volume...

(OP)
Yes the result is correct.

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