Hello, I'm wondering what is truely being returned when I ask for the reference set of an unloaded component? (component.ReferenceSet)
I ask because I've noticed quite a large difference in my assembly when the components are loaded vs unloaded. For example, test 1 was with no components loaded and there were 175 components on the empty reference set. Test 2 was with all the components fully loaded and there were 500+ components in the empty reference set.
A program I'm working on makes decisions on what to do with components based on their reference sets, (skipping empty reference sets) and I'm worried that if the component is not loaded I won't be grabbing accurate information. Especially if when unloaded the component is in the empty reference set, but when loaded it's in the entire part reference set.
Solved! Go to Solution.
I'd be wary of any information returned from an unloaded component. I've not tested it, but I'd guess you are getting the reference set that was used the last time the component was open.
The reference set that a component uses when opened is determined by your load options.
As mentioned previously, the reference set to use when loading the component is determined by your assembly load options (file -> options -> assembly load options). In the screenshot below, you can see the reference set options: Special, use model, as saved, entire part, empty. With the load options set as below, when NX opens a component (any component) it will attempt to use the ref set named "special". If this ref set is not found in the file, it will move on to the next option in the list, the model ref set. If, for some reason, the file does not have a model ref set, it moves on to the next option in the list. It works down the list until it finds one that works (entire part or empty will work every time).
The question is: what reference set is the unloaded component reporting? I suspect it is the last used reference set (the as-saved one), though I've not tested this theory.