Showing results for 
Search instead for 
Do you mean 
Reply

Wrong reference set returning upon code exec...

Hi, 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 refernce 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...