GOAL
------------------------------------------------------------------------------------------------------------------------------------------
To use AutoCAD® Map 3D 2016 ObjectARX .NET Reference (VB.net) to import a .GML file specified by file location into an active CAD drawing. I am using Autodesk::Gis::Map::ImportExport
SYSTEM SETUP
------------------------------------------------------------------------------------------------------------------------------------------
STEPS I USED:
------------------------------------------------------------------------------------------------------------------------------------------
PROBLEM:
------------------------------------------------------------------------------------------------------------------------------------------
I get an Unhandled exception has occurred in a component in your application. If you click Continue, the application will ignore this error and attempt to continue. Object reference not set to an instance of an object
HELP:
------------------------------------------------------------------------------------------------------------------------------------------
Please help me determine what is causing this? If I hit continue, nothing else happens and my files are not imported, nothing happens. I’m a fairly beginner .NET programmer, and CAD isn’t my specialty, but I have written a couple extensions to CAD recently. I am a very experienced software developer in other languages, so please bear that in mind... I tried to provide all my environment setup, do I have something not set up properly that you can see? The error message is not at all helpful, I cannot see what is happening.
Once this is fixed and proof of concept is created, I need to add GML type to the import file, and have it import the GML file into the current drawing on it’s own layer. I had assumed I could just add/extend this application to handle GML files, but perhaps there is more to it. Any detailed advice would be greatly appreciated.
Thank you in advance.
Solved! Go to Solution.
Solved by Alfred.NESWADBA. Go to Solution.
Hi,
before starting to use that sample, have you verified that the GML-file can be imported using command _MAPIMPORT?
Map3D is not too stable with that things as it sometimes does not find links to XSD defined within the GML file.
And to make sure we do the same tests: can you upload the file you are trying to import?
At least: the screenshots from error messages are a bit help, the detail-info (as textfiles) from the exception dialog would give us more details about what happened in your project.
- alfred -
Thank you Alfred. So the GML file had worked when we initially tested it a while back, but decided I better retest that portion with mapimport command via CAD when you mentioned this, and it was not working. My coworker recreated the file and still did not work. Finally he tried again with the .xsd file in the same directory as the .gml file, and it worked via mapimport. I then modified the Sample Code to allow GML file types, and attempted through the DLL and it loaded in properly. Thank you for aiming me back to the file first. I've had lots of different issues with this import thing, grateful it seems to be behaving now and the file type is correct.
Can't find what you're looking for? Ask the community or share your knowledge.