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

Massive export of DWG to Shapefile by Layer

21 REPLIES 21
Reply
Message 1 of 22
Vasily_BC
6344 Views, 21 Replies

Massive export of DWG to Shapefile by Layer

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

21 REPLIES 21
Message 2 of 22
Alfred.NESWADBA
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 ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 22
braudpat
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

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 4 of 22


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).

Message 5 of 22
parkr4st
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

 

 

 

 

Message 6 of 22
Vasily_BC
in reply to: braudpat

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

Message 7 of 22
Vasily_BC
in reply to: antoniovinci

Thanks Antonio.

Message 8 of 22
antoniovinci
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".

Message 9 of 22
Murph_Map
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
Supporting the troops daily.
Message 10 of 22
parkr4st
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

Message 11 of 22
Vasily_BC
in reply to: Vasily_BC

By "massive export" I meant routine that may allow to export all drawing content to shapefile and separate it by layer. However, I don't know how to separate points, polygons and lines.

The number of drawings wasn't big and I already did export but would be interesting to have something like this in arsenal.

Message 12 of 22
antoniovinci
in reply to: Vasily_BC


Vasily_BC wrote:

I don't know how to separate points, polygons and lines.


You should simply run the _MAPEXPORT routine three times, because Autocad will filter the right objects for you, sir.

Message 13 of 22
Vasily_BC
in reply to: antoniovinci

I mean I don't know how to run it at once)

Message 14 of 22
Murph_Map
in reply to: Vasily_BC

When you export select the Shape MultiClass file format. It will create mulitple shp files from each type of object.

 

mulitclass.png

Murph
Supporting the troops daily.
Message 15 of 22
antoniovinci
in reply to: Murph_Map

That's nice, Murph, but I haven't it in my Map2006: do you know since which release is it available..?

Message 16 of 22
Murph_Map
in reply to: antoniovinci


@antoniovinci wrote:

That's nice, Murph, but I haven't it in my Map2006: do you know since which release is it available..?


I want to say 2008 but I know it was in 2010.

Murph
Supporting the troops daily.
Message 17 of 22
Alfred.NESWADBA
in reply to: Murph_Map

Hi,

 

>> I want to say 2008 but I know it was in 2010.

Verified now: Civil3D 2008 (and so I assume Map3D 2008) was the first version which included Multiclass SHP export.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 18 of 22
braudpat
in reply to: Alfred.NESWADBA

 

Hello

 

I vote for MAPEXPORT one (or a few)  layer(s) by layer(s)  OR  one geometry by one geometry

with the help of a script file which freeze all layers except the layers for the next MAPEXPORT

and etc ...

( You can include the LAYERNAME as an attribute if necessary )

 

It's easy and reliable ... 

It can run with ANY version of MAP/CIVIL : 2004-2014

 

http://www.cadtutor.net/forum/showthread.php?t=22519

(command "._mapexport" "SHP" "C:\\temp\\test.shp" "_N" "_S" "_LINE" "_ALL" "*" "*" "_N" "_Proceed")

 

Bye, Pat

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 19 of 22
balendra.shukla
in reply to: Vasily_BC

HI Murph,

you are amaging,

i read  so may post of your, you have a perfect solution for any problem..

Thanks it works no eed of any routine option is available in mapexport. command

Message 20 of 22
Murph_Map
in reply to: balendra.shukla


@balendra.shukla wrote:

HI Murph,

you are amaging,

i read  so may post of your, you have a perfect solution for any problem..

Thanks it works no eed of any routine option is available in mapexport. command


Your welcome, too bad I wasn't able to get employment back in the field of mapping and geospatial. 😞

Murph
Supporting the troops daily.

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

Post to forums  

Autodesk Design & Make Report

”Boost