Infrastructure Map Server Developer

Infrastructure Map Server Developer

Reply
New Member
1 Posts
0 Kudos
Registered: ‎06-04-2008
Post 1 of 1

Studio 2009 API DwgLoadProcedure

40 Views, 0 Replies
10-16-2008 01:05 AM
I have a problem with Studio APIs DwgLoadProcedure. My code is this:

{color:#0000ff}DwgLoadProcedure loadProcedure = new DwgLoadProcedure();

loadProcedure.SourceFiles.Add(@file);
loadProcedure.RootPath = myRoot;
loadProcedure.CoordinateSystem = coordSys;

loadProcedure.ClosedPolylinesToPolygons = false;
loadProcedure.Generalization = 100;

loadProcedure.GenerateSpatialDataSources = true;
loadProcedure.SpatialDataSourcesFolder = "Data";
loadProcedure.SpatialDataSourcesPath = "";
loadProcedure.GenerateLayers = false;
loadProcedure.GenerateMaps = false;
loadProcedure.GenerateSymbolLibraries = true;
loadProcedure.SymbolLibrariesFolder = "Symbols";
loadProcedure.SymbolLibrariesPath = "";

loadProcedure.Execute(connection);{color}

At the line {color:#0000ff}loadProcedure.Execute(connection), {color}the app throws an error:

{color:#ff0000}System.AccessViolationException was unhandled by user code
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="Autodesk.MapGuide.Studio.Dwg.Load"
StackTrace:
at BlockConverter.Convert(BlockConverter* , AcDbBlockTableRecord* )
at Autodesk.MapGuide.Studio.Load.DwgLoadProcedure.BlocksToSymbols(String srcFile, AcDbDatabase* pDb, PackageWriter pkg, SiteConnection connection)
at Autodesk.MapGuide.Studio.Load.DwgLoadProcedure.WriteSymbolsOnly(PackageWriter pkg, SiteConnection connection)
at Autodesk.MapGuide.Studio.Load.DwgLoadProcedure.Execute(String packageFilePath, SiteConnection connection)
at Autodesk.MapGuide.Studio.Load.LoadProcedure.Execute(SiteConnection connection)
{color}
{color:#000000}I've done the same with DwfLoadProcedure and that works perfectly!{color} It's something to do with the symbol library. If I make this change {color:#0000ff} loadProcedure.GenerateSymbolLibraries = false, {color:#000000}the error doesn't occur but, ...well you can imagine how a dwg looks like without a symbol library, just lines and points....

I know that in Studio 2009 they made some changes with handling dwgs. But this has to be possible somehow!

Any advices are appreaciated!

Tanja
{color}{color}
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post