Min distance between assemblies


I have been trying to get min distance between two assemblies or one part and an assembly using the ActiveDocument.MinimumDistance(...) method. It works fine with two parts, but when an assembly is present I get the error "Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))".


The parts and assemblies are retreived from the Occurrences of the active document.

Is it in fact possible to do this? When I look at the Occurrence objects, all seem to have a problem in some of the attributes, e.g. the body attribute (listed as the error above).

I have tried different models, some very simple, with the same result. I use Solid Edge V20 and Microsoft Visual Basic 2005.


Posted by: Magnus Lindgren
Post date: 11/23/2009 3:08:48 AM


RE: Min distance between assemblies



I can only confirm what you're seeing. I tested using ST1.


I believe a call to GTAC is in order.


Posted by: Jason Newell
Post date: 11/23/2009 3:19:57 PM

RE: Min distance between assemblies

Sorry i don't have time now to prepare a test for this.

Just some clues:

- An assembly is nothing itself to get min distances,

- I think you should measure min distances between parts inside that subassembly and something else in the main assembly.

To do this properly i think you should get a reference to an occurrence inside the subassembly and measure that.

To get the reference object, use the CreateReference method in AssemblyDocument.





Posted by: Julian Guillo
Post date: 11/23/2009 8:47:39 PM

RE: Min distance between assemblies


Thank you for the fast replies!

Now that I know the min distance doesn't work with assemblies I can cope with it by converting these to parts.

Doing it with references, as Julian suggested, could work. But my problem is that I have assembles within assemblies, etc. and would have a really hard time debugging it.

Futhermore when I try to do other things with my Occurences I get the same error as before, even for a single part. E.g. I tried the move method of the Occurrence ( Object.Move(DeltaX, DeltaY, DeltaZ) ) and failed with "Unspecified error ... E_FAIL".


Posted by: Magnus Lindgren
Post date: 11/23/2009 11:46:18 PM