Search code examples
vbavisual-studiodebuggingcomcatia

{System.__ComObject} properties in Visual Studio debugger not the same as Excel VB


I've been trying everything for a week and I cannot find a soltion for this. The problem is that I have been automating process in CATIA with Excel VB and now I want to use Visual Studio 2015. The only problem that I have is the debugger in Visual Studio. When I use:

Dim CATIA As INFITF.Application = GetObject(, "CATIA.Application");

I have a {System.__ComObject} as a result, clicking on "Dynamic View" (Debugger/Locals) I dont get any propertie of the object. If instead of CATIA.Application, Excel.Application is used I can see in the "Dynamic View" the different properties of the object.

http://stpserver.webcindario.com/vstudiodebugger.png

Also when I type the code:

Set CATIA = GetObject(,"CATIA.Application")

In Excel VBA, in the debugger it will appear all the properties of the object.

http://stpserver.webcindario.com/excevbadebugger.png

My question is how I can see in the Visual Studio 2015 debugger window the properties of the CATIA object as I can see them in Excel VB debugger.

PD: I have imported all the necessary references in Visual Studio 2015


Solution

  • Related post: Use C# for Catia V5 Automation

    Sadly I do not know the exact VB.net code you will need but this should point you in the right direction. Since you want the COM object the process is the same, only the syntax is different.

    In your Visual Studio project right click and Add Reference. Under the COM tab, Type Libraries section look for: CATIA V5 InfInterfaces Object Library. This is needed for INFITF.Application. If you want to work with other objects in Catia you will need MecModInterfaces, PartInterfaces, ProductInterfaces, and for HybridShape types you will need the CATGSMIDLItf Object Library (This has a different name prior to R23 but I do not remember what it was). After that you need to use Marshal to attach to the Catia process.

    The version of Visual Studio should not matter since you are using COM. It does matter if you are using CAA-RADE which has version specific tools. I have successfully used Visual Studio 2010 (with Catia R19-20), VS2012 (with Catia R22 and R23), VS2013 and VS2015 (with Catia R23). I think your problem might be with the missing references.