I'm just starting into C#, and I'm attempting to write a little code that only works if we have a 3D Shape active.
I'm basically working through the object browser to try to figure this out, so any pro tips on making this struggle a bit easier, would be greatly appreciated.
With this code, the message box always returns a value of 'System.__ComObject'. I don't know if that's because I'm trying to obtain the type from the system library, instead of a Catia library...
I'm basically working through the object browser to try to figure this out, so any pro tips on making this struggle a bit easier, would be greatly appreciated.
Code:
using System;
using INFITF;
using MECMOD;
using HybridShapeTypeLib;
namespace VSTA_Applications_xxxxxx_vst00000001_A_1
{
public sealed partial class ThisApplication : ObjectModelAgentLib.CATIAEntryPoint
{
public static void Macro_xxxxxxx()
{
Editor iEditor = CATIA.ActiveEditor;
string iEditName = iEditor.ActiveObject.GetType().ToString();
System.Windows.Forms.MessageBox.Show("Editor name = " + iEditName);
if (iEditName != "VPMRepReference")
{
<do more stuff>
}
}
}
}
With this code, the message box always returns a value of 'System.__ComObject'. I don't know if that's because I'm trying to obtain the type from the system library, instead of a Catia library...