Showing results for 
Search instead for 
Do you mean 
Reply

Different tags for the same component?

If I use python to get the assembly tree structure I can get a set of component tags. However, when I try to find components from constraints, they give me different tags for the "same" components. This does not happen in the first level components. I have a sample assembly with a subasembly. The above mentioned problem happens in the second level of assembly. 

 

1. The way I used to get the assembly tree structure is to use component.GetChildren() recursively. Tags for each component could be found correspondingly. 

 

2. The way I used to get the components connected with assembly constraints is: get the direct owner of the component at hand, which gives a componentassembly. From component assembly we can get the positioner for that component assembly. Constraint collection could be find from positioner, which is a collection of constraints within the component assembly. For each constraint, we can get the constraint references. For each constraint reference, we can get the movable object, which is a component.  The problem is this components we get (if it is at a lower level in the assembly) have different tags from what we get from first step (1.) 

 

Is there anything I did wrong? Or it is just the case that a component can have different tags within a session? 

 

Any help will be appreciated. 

 

 

8 REPLIES

Re: Different tags for the same component?

Lets say you have assembly A that contains B and B contains C.

 

In your first approach, you are geeting the component C in assembly A since you are sarting in the root.

 

In the second approach, you are getting the component C in assembly B, which is different from the above. It isanother NXOnject so has different tag. But both will have the same prototype, which is the part file containing C.

 

Elias.

Re: Different tags for the same component?

That's interesting. Why would they do it like this? It just duplicates things. 

 

Is there any way we can find that those different tags are actually about the same component? 

 

Thank you.

Re: Different tags for the same component?

The NXOpen SNAP users guide has a good explanation and image of how assemblies are related.

Remember that the physical part can be included multiple times in an assembly and one needs to keep track of what location the part is, so one needs different tags.

There are API functions and methods to get all occurrences of a physical part in an assembly.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Different tags for the same component?

Ask the Prototype() for each component and check if it is the same.

 

Elias.

Re: Different tags for the same component?

That would only work when the prototype has only one occurence in the assembly. Thank you for your suggestions though. 

Re: Different tags for the same component?

It should work also if you have many occurrence of the same prototype ...

Re: Different tags for the same component?

I mean, for example, when a wheel prototype has four wheel instances in a car assembly, if we look at the prototype tag of a wheel component, we do not know which one it is out of the four component. 

Re: Different tags for the same component?


wallace_cheng wrote:

I mean, for example, when a wheel prototype has four wheel instances in a car assembly, if we look at the prototype tag of a wheel component, we do not know which one it is out of the four component. 


If you have the prototype, then you do not have any of the 4 occurrences; the prototype is separate from the components. The prototype and each component will have its own tag. There are functions in the API to get the component(s) given the prototype or to get the prototype given a component.