Reply

Accessing PartDocument.Models generates exception

[ Edited ]

 

Hello Jason,

I have a question on Solid Edge Spy.

I have a SolidEdgePartSync.PartDocument

when I access .Models, I get an exception. This used to work before, but since I upgraded to SolidEdge st, I've been having some difficulties.

What I'm wondering is how come .Models and its contents are available and I can see them in SolidEdge Spy.

Are you using COM to make this work in that case? It seems with .Net there's a problem.

Can you tell me also what the syntax is to access .Models using COM?

Thanks

Chahé

 

Posted by: Chahe Adourian
Post date: 9/13/2008 3:22:56 PM

3 REPLIES

RE: Accessing PartDocument.Models generates exception

[ Edited ]

Chahé

 

Are you declaring your variable as SolidEdgePart.Models or SolidEdgePartSync.Models. Depending on what document type your working with, you'll need to use the appropriate type. Solid Edge Spy uses late binding to discover the objects but you should always use early binding.

 

Posted by: Jason Newell
Post date: 9/15/2008 4:38:15 AM

RE: Accessing PartDocument.Models generates exception

[ Edited ]

 

Hi Jason,

I do check whether the document is an igPartDocument or igSyncPartDocument, and use the appropriate type cast

SolidEdgePart.PartDocument partdoc = (SolidEdgePart.PartDocument) myDoc;

or

SolidEdgePartSync.PartDocument syncPartDoc = (SolidEdgePartSync.PartDocument) myDoc;

My problem seems intermittent/random. After I posted my message, and not having change anything in my code, it is working. So problem solved.

What i don't understand is what changed since I didn't change anything.

So problem solved for now,

Thanks

Chahe

 

Posted by: Chahe Adourian
Post date: 9/15/2008 2:34:11 PM

RE: Accessing PartDocument.Models generates exception

[ Edited ]

 

Ok. I figured out what causes the exception;

 

SolidEdgePartSync.PartDocument.Models --> causes an error

SolidEdgePart.PartDocument.Models --> works everytime.

SolidEdge Spy is able to see the Models Interface of a igSyncPartDocument. However, accessing

SolidEdgePartSync.PartDocument.Models --> causes an error

Any ideas why? Any programming with SolidEdge ST seen this problem?

 

Thanks

 

Chahe

 

 

Posted by: Chahe Adourian
Post date: 9/22/2008 5:11:41 PM