I have simple program that look like this
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Autodesk.Gis.Map.Platform.Interop; using Autodesk.Gis.Map.Platform; using Autodesk.AutoCAD.Runtime; using OSGeo.MapGuide; namespace probaAcMapMap { public class Class1 { [CommandMethod("nesto")] public void nesto() { AcMapMap map = AcMapMap.GetCurrentMap(); } } }
and I'm getting this exception "Failed to retrieve message for "MgInvalidArgumentException"."
This code is working just fine in 2010 and VS2008.
This code is builded with VS2010
Am I missing some reference or what?
Solved! Go to Solution.
Solved by kob4lt. Go to Solution.
I tried your code with my AcadMap2011 and VS2010 (the project is set to target .NET4.0). It compiles OK and runs OK (this is the sigle line of code "AcMapAmp map=....' does not cause exception).
I believe civil3d 2011 has all AcadMap2011 functionalities plus more.
Well, to allow AcadMap2011 work with .NET 4.0, I have this in acad.exe.config:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
...
</configuration>
Norman Yuan
I kindly figured out the problem. When I compile the program and start it, he throw an error. If I do that again (fresh start) except I call mapwspace command and than call my program, its ok.
I think it is because the map it is not initialized or something. If I look in my text window with F2 I saw some command like this MAPDMDWGLOADED???