Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Studio 2009 API DwgLoadProcedure

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
193 Views, 0 Replies

Studio 2009 API DwgLoadProcedure

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}
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report