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

Cannot get Map::ImportExport Sample DotNet to work need to import a .GML file

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
826 Views, 2 Replies

Cannot get Map::ImportExport Sample DotNet to work need to import a .GML file

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

------------------------------------------------------------------------------------------------------------------------------------------

  • Windows 10 Computer
  • Civil Map 3D 2016
  • Visual Studio 2015
  • C:\Map ObjectARX SDK 2016
  • C:\ ObjectARX 2016

 

STEPS I USED:

------------------------------------------------------------------------------------------------------------------------------------------

  • I wanted to test the Sample Code for the ImportExport as a starting point.
  • I opened c:\Map ObjectARX SDK 2016\Map Samples\DotNet\ImportExportVB\ImportExportVB.sln in Visual Studio Professional 2015.
  • I updated the References of the project, assigning the DLLs to the proper file location on my system.
  • I fully compiled the code, and created bin\ImportExport.dll
  • I started Civil 3D 2016 (with Map also activated).
  • Netload c:\Map ObjectARX SDK 2016\Map Samples\DotNet\ImportExportVB\bin\ImportExport.dll
  • Typed runimport
  • The Import Dialog comes up, and I choose a .MIF (I’ve done with a .TAB file as well). I’ve chosen pretty much any combination of check boxes and such.
  • Click on Ok

 

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

  • See attached screen shots with configuration, and exact pop up error message.

 

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.

 

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: Anonymous

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 3
Anonymous
in reply to: Alfred.NESWADBA

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.

Post to forums  

Technology Administrators


AutoCAD Beta