Reply
Solved! Go to solution

Lost reference

[ Edited ]

I noticed when a face or edge has changed due to some operation like cut or split etc. the reference is lost and the only way to get the face back for more operations is to pre-store its ID and query it back using the Faces collection.

 

Has anyone faced a similar problem. How did you solve it ?

 

I thought of storing attributes on the face to retrieve it back later when the reference is lost but ID seems to be reliable and working for now.

 

I wrote TopoTools just to assist with this task. If there is a proper solution, I am still willing to to adopt it instead of the clumsy and time consuming TopoTools + Spy combination.

 

Thanks,

Tushar

 

4 REPLIES
Solution
Solution
Accepted by topic author Tushar
‎04-28-2016 06:22 AM

Re: Lost reference

I had a similar problem and the solutions seems to be to use the "ReferenceKey" of the face\edge etc. instead of the ID. For what I have learned the "ReferenceKey" is unique and doesn't change in subsequent events.

Unfortunately the use of the "ReferenceKey" is not that easy (for my skills) as the ID.
I have problem to store them to be usable to retrieve the referenced object later.

I did give up after some time spend trying it, programming is not my primary work.

I would be very happy if there were an already written code to store ReferenceKeys and to retrieve Objects based on that stored ReferenceKeys.

A challenge for you Tushar ? :-)

Re: Lost reference

[ Edited ]

Thank you so much Francesco for the much needed hint.

I worked it out the following way:

 

		Dim bRefKey() As Byte = {}
		oFace.GetReferenceKey(bRefKey)
' Modify the face between here oDoc.BindKeyToObject(bRefKey, oFace)

 

Works like a charm !

 

~Tushar

Solution
Solution
Accepted by topic author Tushar
‎04-29-2016 12:02 AM

Re: Lost reference

Just to explain the differences between the Parasolid ID and the ReferenceKey:

 

* the Parasolid ID is unique during a session and may change when you later open the same document again, so this ID is NOT persistent

 

* if you need persistency between sessions, then you definitely need to use the ReferenceKeys, as they remain the same over multiple sessions and it is easy to retrieve the topology by using the BindKeyToObject() method on the Solid Edge document

Re: Lost reference

Thank you @MartinBernhard for the insight.

 

~Tushar