Showing results for 
Search instead for 
Did you mean: 

C# equivalent of code

Valued Contributor
Valued Contributor


Hello ,

there's a piece of code from the Solid Edge ST .Net Programmers Guide that I'm trying to implement in C# but without success; There seems to somethings missing in C# versus in

The code is on page 88 of that document (see below);

In particular I cannot determine the type of a Relation3d object in C#, which is easily and directly accessible in (i.e. objRelation3d.Type)

I've try to use the C# Object .GetType() method and all sorts of different approaches but none of them worked. Finally, I compiled the offending piece in and used it in C#;

Any idea how to implement the equivalent of objRelation3d.Type in C#?



--------- Code  --------


objAssembly = objApplication.ActiveDocument

' Get a reference to the relations 3d collection

objRelations3d = objAssembly.Relations3d ' Loop through the relations 3d objects

 ForEach objRelation3d In objRelations3d ' Determine the relation type



objAngularRelation3d = objRelation3d


objAxialRelation3d = objRelation3d


objGroundRelation3d = objRelation3d


objPointRelation3d = objRelation3d


objPlanarRelation3d = objRelation3d

 SelectCase objRelation3d.TypeCase SolidEdgeFramework.ObjectType.igAngularRelation3dCase SolidEdgeFramework.ObjectType.igAxialRelation3dCase SolidEdgeFramework.ObjectType.igGroundRelation3dCase SolidEdgeFramework.ObjectType.igPointRelation3dCase SolidEdgeFramework.ObjectType.igPlanarRelation3dEndSelect



Posted by: Chahe Adourian
Post date: 9/16/2008 1:43:59 PM


RE: C# equivalent of code

Valued Contributor
Valued Contributor


VB does a lot of "stuff" for you.  C# is a little more work.

 SolidEdgeAssembly.Relations3d relations3d = assemblyDocument.Relations3d;for (int i = 1; i


Posted by: Jason Newell
Post date: 9/17/2008 7:30:10 AM

RE: C# equivalent of code

Valued Contributor
Valued Contributor




Thanks Jason.


Posted by: Chahe Adourian
Post date: 9/18/2008 12:40:56 PM