AutoCAD Map 3D General Discussion

AutoCAD Map 3D General Discussion

Reply
Distinguished Contributor
Vasily_BC
Posts: 106
Registered: ‎04-27-2012
Message 1 of 21 (1,205 Views)

Massive export of DWG to Shapefile by Layer

1205 Views, 20 Replies
08-14-2013 03:40 PM

Hi,

 

Is there a way to do massive export of dwg file to shapefile by layer?

I have number of drawings that need to be converted to shapefile and I don't want to do export layer by layer.

 

Thanks

*Expert Elite*
Alfred.NESWADBA
Posts: 9,417
Registered: ‎06-29-2007
Message 2 of 21 (1,184 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 12:25 AM in reply to: Vasily_BC

Hi,

 

there is no ready-to-use function for that, but at least a script or a small macro (lisp or vba) should do that job.

Another option (not great but may be possible): what if you export all layers into one shape file and include the layername as one of the exported attributes? You will then be able to filter by this layername-field in any SHP-visualization software.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
braudpat
Posts: 2,338
Registered: ‎12-15-2006
Message 3 of 21 (1,179 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 12:51 AM in reply to: Alfred.NESWADBA

Hello

 

I think that a Script file is the solution because it's very nice to get ONE SHP per object type / geometry :

parcels, buildings, sewer pipes, water pipes, streets names, parcels identifiers, etc ...

 

Bye, Pat

 

Bye, Pat ( Supporting Troops )
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Compliment) - Thanks
*Expert Elite*
antoniovinci
Posts: 1,750
Registered: ‎06-03-2011
Message 4 of 21 (1,173 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 01:02 AM in reply to: Alfred.NESWADBA

alfred.neswadba wrote:
export all layers into one shape file and include the layername as one of the exported attributes

I would use that technique, indeed.
After _MAPEXPORT everything to a single shapefile, containing the layer name as an attribute, you can split automatically it by layer, by means of Qgis (for instance).

Valued Mentor
parkr4st
Posts: 464
Registered: ‎03-24-2004
Message 5 of 21 (1,168 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 01:52 AM in reply to: Vasily_BC

backing up a bit, one does not "export dwgs" to shp but rather objects with or without data attached and/or attributes, etc.

 

is it possible to combine your dwgs with drawing attach and make one dwg from which to export to the shp? 

 

this gives you some options to change layer names if the names for like objects are different in the various dwgs such as layer names like road, roads, streets, highways could all be changed to ROADS so all of the traveled paths are on one layer with the object data such as number of lanes or surface type or municipality would allow theming the shp data.

 

dave

 

 

 

 

Distinguished Contributor
Vasily_BC
Posts: 106
Registered: ‎04-27-2012
Message 6 of 21 (1,151 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 09:10 AM in reply to: braudpat

This probably would make a long list of shapefiles. Antonio's suggestions looks reasonable in this case.

Distinguished Contributor
Vasily_BC
Posts: 106
Registered: ‎04-27-2012
Message 7 of 21 (1,150 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 09:11 AM in reply to: antoniovinci

Thanks Antonio.

*Expert Elite*
antoniovinci
Posts: 1,750
Registered: ‎06-03-2011
Message 8 of 21 (1,146 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 09:24 AM in reply to: Vasily_BC

I'd like to forward the credits to Alfred, since the previous suggestion belongs to him: as we say in Italy, I've only "closed the circle".

*Expert Elite*
Murph
Posts: 2,064
Registered: ‎11-13-2006
Message 9 of 21 (1,137 Views)

Re: Massive export of DWG to Shapefile by Layer

08-15-2013 06:07 PM in reply to: Vasily_BC

May be late to the party and don't even know if this still works in newer versions, bu this would be one way to do it.

First in a new dwg use the mapattach tools and attach all the dwgs then query in the layers you want to export. Next export to SDF and use feature classes setting the feature name by the layers. This would create a multi type SDF file with the layers names as the features(layerS) name. Then I would use something like FDO2FDO to convert the SDF file to shp files, or use bulk copy.

Murph
Supportting the troops daily.
Valued Mentor
parkr4st
Posts: 464
Registered: ‎03-24-2004
Message 10 of 21 (1,125 Views)

Re: Massive export of DWG to Shapefile by Layer

08-16-2013 02:56 AM in reply to: Vasily_BC

so regardless of how you congregate the data, back to the OP with "massive export" which is something i have not done. Could you help enlighten me, please.  what is a "massive export " ?  exporting en masse as with a script or very massive amounts of data"

 

and how many drawings is "a number"?  At what point is it worth the time to write the script if one does not exist to do the task versus using something like my or Murphs suggestion? 

 

As far as the final number of layers, all methods suggested could be used to arrive at any given number of layers.  Just relative to how much you caress the data.  I look at this poser as "How do I combine all the data from multiple dwgs(Maps?) into a given number of data sources of the shp fileformat ?"  Am I off on that?

 

And by the way, are all the dwgs maps with (a) coordinate system(s) set or is there a need to go some georeferencing along the way?

 

Thanks for all your help folks. still learning from all of you.

 

dave

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!