joerg.schmidt

Access to CES .Application.Tools.ObjectDefs via C# or DotNet

Discussion created by joerg.schmidt on Feb 2, 2012
Latest reply on Dec 13, 2012 by lary.e

Hello,

 

i would liket to access the ObjectDefs - object via C#.

The CES automation license is installed and i can get the Ces.Application.

To get the electrical nets and net classes i need a ObjectDefs object which i got in VBScript code with following lines:

 

Set CesApp = GetObject(, "Ces.Application")

Set CES = CesApp.Tools("CES")

Set CmsObjDefs = CES.ObjectDefs

Set NetClasses = CmsObjDefs.Design.NetClasses

Set ElectricNets = CmsObjDefs.Design.PhysNets

 

In C# i can create the Ces.Application object. (I have installed an automation license which works)

But i don't get a ObjectDefs object because its not a member of the Ces.Application.Tools.

Here is the code so far.

 

Ces.Application CesApp; //The CES Application Handler

Ces.Tools CesTools;

CesApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Ces.Application.Tools.ObjectDefs ") as Ces.Application;

CesTools = CesApp.Tools;

CmsObjDes = CesTools.??? ObjectDefs is not available

 

So how do i get access to the ObjectDefs object of the CES.Application?

Included Mentor related namespaces are:

using ViewDraw;

using Ces;

 

Maybe i need some other namespaces?

 

Thanks for your help and best regards,

 

Joerg

Outcomes