Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Code returns wrong reference set and volume...

Status
Not open for further replies.

junfanbl

Marine/Ocean
Jun 10, 2015
90
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...

 
Replies continue below

Recommended for you

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
 
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.

 
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?
 
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
 
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor