Reply

Instance path not available from Relation3d

[ Edited ]

 

Hello All,

in an multi-level assembly document where the same subassembly may be repeated multiple times, I am trying to figure out the full instance path of the two ends of a relation3d;

For example, I have

D.asm

----- PartD1.par

----- PartD2.par

----- C.asm:1

------------- B.asm:1 - PartB.par

--------------B.asm:2 - PartB.par

From within D.asm I create two Relation3d objects (using GUI)  RelA an RelB as follows:

RelA(PartD1.par,  C.asm:1 - B.asm:1 - PartB.par)

RelB(PartD2.par,  C.asm:1 - B.asm:2 - PartB.par)

Now, unfortunately, the full path is not easy to find (I couldn't find it). What I have so far is the following:

RelA.OccurrenceA = PartD1.par,

RelA.OccurrenceB = C.asm:1

Obviously, I cannot deduce from that which PartB.par RelA connects to; That in B.asm:1 or in B.asm:2

in other words, do I have

RelA(PartD1.par,  C.asm:1 - B.asm:1 - PartB.par)

or

RelA(PartD1.par,  C.asm:1 - B.asm:2 - PartB.par)

 

I can get a bit more information if I use:

element2 = RelA.GetElement2(...)

from element2 I can deduce that its parent is "B.asm". Not B.asm:1 or B.asm:2; just B.asm

In other words, the instance information is lost; Element1 seems to be within the B.asm Class and not the B.asm:1 or B.asm:2 instances.

Anyone have any ideas? Reference Keys, HashCodes have been useless in giving me unique IDs. SubOccurrences have been useless as well.

Thanks for any pointers. I've been working on this for two weeks now. I would appreciate any hints.

Chahe

 

 

Posted by: Chahe Adourian
Post date: 10/3/2008 3:19:12 PM

3 REPLIES

RE: Instance path not available from Relation3d

[ Edited ]

Chahe,

 

the GetElement2() method should give you a Reference object, from which you can query the Object to which it points and its ImmediateParent (should either be another Reference or the TopLevelAssembly) to recursively iterate the InstancePath bottom up.

I am writing this directly from my memory without any sample aside, so I may be totally wrong, but I believe I have done something similar already in the past. I'll have to look for it and may give you some more info tomorrow.

In the meanwhile, you may try to iterate through the ImmediateParents and dump the Type and Name property (if it exists) of the Reference's Object property and see if it gives you what you are looking for.

 

HTH,

Martin

 

Posted by: Martin Bernhard
Post date: 10/6/2008 12:23:53 PM

RE: Instance path not available from Relation3d

[ Edited ]

Hello Martin,

 

I've investigated all the visible properties I get from Element1 = GetElement1() ... which include, Object, Parent; Parent leads to a class assembly and not the instance; Ie. I get the Part instance, but its parent is a class

 

Object leads to, if I remember, graphical information

TopLevelDocument is too high; I need to move up step by step.

 

I don't see ImmediateParent, unless i use InvokeMethod to access it; I'll try that;

 

I noticed that to create a Relation3d to a graphical object of an occurrence, we need to create a reference key as a function of both occurrence and graphical object; Maybe the element1 ReferenceKey is made of two parts: reference key of occurrence + reference key of graphical object;

 

Thanks

 

Chahe

 

Posted by: Chahe Adourian
Post date: 10/7/2008 2:59:32 PM

RE: Instance path not available from Relation3d

[ Edited ]

Chahe,

 

I have an own tool similar to Jason's SolidEdgeSpy, but which shows some more info than just the object properties. It shows me that the Element1 and Element2 are both References, where the Object property is a Face and the Parent/ImmediateParent are its containing Occurrence (PartB.par:1). I was expecting the ImmediateParent to return another Reference object, but in this case you don't have any possiblity to identify the PartB occurrence correctly (to which PartB.asm occurrence it belongs).

 

Martin

 

Posted by: Martin Bernhard
Post date: 10/8/2008 3:32:55 AM