Thanks for the quick reply I'll try it without the casts,it's not pretty but this is how I did it in Visual Studio/C# Manifold.Interop.Application mapApplication; Manifold.Interop.Document mapActiveDocument; Manifold.Interop.ComponentSet mapActiveComponentSet; Manifold.Interop.Drawing mapDrawing; Manifold.Interop.ObjectSet mapObjectSet; string strMapFilePath=@"c:\Users\Public\"; string strMapFileName = "Test.map"; string strMapComponentName="MapDrawing"; int intMapObjectSetCount=0; mapApplication = maMAP.Application; mapActiveDocument = (Manifold.Interop.Document)mapApplication.ActiveDocument; mapActiveDocument.Open(strMapFilePath + strMapFileName, true, false); mapActiveComponentSet = (Manifold.Interop.ComponentSet)mapActiveDocument.ComponentSet; mapDrawing = (Manifold.Interop.Drawing)mapActiveComponentSet[strMapComponentName]; mapObjectSet = (Manifold.Interop.ObjectSet)mapDrawing.ObjectSet; intMapObjectSetCount = mapObjectSet.Count; TextBoxCount.Text = intMapObjectSetCount.ToString();
|