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: 

Problem with exporting to ESRI SHAPE

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
537 Views, 9 Replies

Problem with exporting to ESRI SHAPE

Hi,

I have some problems with exporting a drawing to the ESRI Shape format.
I have to create different SHAPEfiles from 1 drawing. In fact, every layer
must become a SHAPEfile.
So I wrote a program in VB. But VB doesn't support a MAPEXPORT command.
So I started using scripts.
And here is the problem :
The MAPEXPORT4 command is not working properly because when i export a
polyline containing arcs the shapefile containes several duplicated points.
In MAP 5 the MAPEXPORT command (command line driven) works well for point en
line SHAPEfiles but not for polygon SHAPEfiles. They are empty.
In MAP 6 the MAPEXPORT command (command line driven) does not support the
export of Object Data to the SHAPEfile. It does when you use a profile, but
i'm not going to make a profile for every layer i have to export .... I
need to be variable.

So, i have 3 questions :

1. When is Autodesk going to make a MAPEXPORT command in VBA or VLISP ?
2. When is Autodesk going to create good and stable commands fo the command
line ?
3. Does anybody have a solution for this problem ?

Thanx in advance...


Stefan
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

Hi Stefan. I am not sure what you are doing wrong but MAPEXPORT in Map6 does support OD tables when exporting to shapefile (even without profiles). The OD tables as well as other properties, SQL links and attributes are found under the DATA tab>>>"Select Attributes" of the MapExport dialog box. Also the fact that every layer must become a shapefile is not an AutoDesk limitation, it is just the way that ESRI shapefiles are handled. ESRI shapefiles do not recognize layers as AutoCAD does, it only recognizes points, polygons, and lines. If your drawing contains primarily many polygons, it may be more efficient to attach an OD table containing a unique layer name to each groups of polygons belonging to that layer. You can then send out all the polygons in one export process and the shapefile layers will be defined by field name in OD table.
Message 3 of 10
Anonymous
in reply to: Anonymous

I can only contribute one small piece of your puzzle. You mention a problem
with exporting polygons. Did you check the box (programmatically of course)
for "treat closed polylines as polygons" ?

--
Shawn (remove HAT to reply)
-----

"Stefan" wrote in message
news:38FA8931C9757EA20CFFB85BFC90D18B@in.WebX.maYIadrTaRb...
> Hi,
>
> I have some problems with exporting a drawing to the ESRI Shape format.
> I have to create different SHAPEfiles from 1 drawing. In fact, every
layer
> must become a SHAPEfile.
> So I wrote a program in VB. But VB doesn't support a MAPEXPORT command.
> So I started using scripts.
> And here is the problem :
> The MAPEXPORT4 command is not working properly because when i export a
> polyline containing arcs the shapefile containes several duplicated
points.
> In MAP 5 the MAPEXPORT command (command line driven) works well for point
en
> line SHAPEfiles but not for polygon SHAPEfiles. They are empty.
> In MAP 6 the MAPEXPORT command (command line driven) does not support the
> export of Object Data to the SHAPEfile. It does when you use a profile,
but
> i'm not going to make a profile for every layer i have to export .... I
> need to be variable.
>
> So, i have 3 questions :
>
> 1. When is Autodesk going to make a MAPEXPORT command in VBA or VLISP ?
> 2. When is Autodesk going to create good and stable commands fo the
command
> line ?
> 3. Does anybody have a solution for this problem ?
>
> Thanx in advance...
>
>
> Stefan
>
>
Message 4 of 10
Anonymous
in reply to: Anonymous

Selliott,

 

I know it is possible to select the object data
with the data tab, but it is not possible when you use the command
line.

Try doing the following :

filedia 0

cmddia 0

mapexport

 

If you can find a way to specify you want to
export Object Data too, please tell me (and AutoDesk because they don't know it
either).

 

And I cannot change the way I'm working (every
layer a different SHAPEfile) because this was asked by the organisation I
writing the program for...

 

Thanx for helping ...


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
Stefan. I am not sure what you are doing wrong but MAPEXPORT in Map6 does
support OD tables when exporting to shapefile (even without profiles). The OD
tables as well as other properties, SQL links and attributes are found under
the DATA tab>>>"Select Attributes" of the MapExport dialog box. Also
the fact that every layer must become a shapefile is not an AutoDesk
limitation, it is just the way that ESRI shapefiles are handled. ESRI
shapefiles do not recognize layers as AutoCAD does, it only recognizes points,
polygons, and lines. If your drawing contains primarily many polygons, it may
be more efficient to attach an OD table containing a unique layer name to each
groups of polygons belonging to that layer. You can then send out all the
polygons in one export process and the shapefile layers will be defined by
field name in OD table.
Message 5 of 10
Anonymous
in reply to: Anonymous

Shawn,

I checked this already many times, but it is checked.
I opened a case at the Autodesk Developpers Network and people of Autodesk
anwered that this is a known problem ...

Thanx for helping...

"Shawn Sumpter" schreef in bericht
news:8886D9AD58C2E9B51C76180B9A5E28CC@in.WebX.maYIadrTaRb...
> I can only contribute one small piece of your puzzle. You mention a
problem
> with exporting polygons. Did you check the box (programmatically of
course)
> for "treat closed polylines as polygons" ?
>
> --
> Shawn (remove HAT to reply)
> -----
>
> "Stefan" wrote in message
> news:38FA8931C9757EA20CFFB85BFC90D18B@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > I have some problems with exporting a drawing to the ESRI Shape format.
> > I have to create different SHAPEfiles from 1 drawing. In fact, every
> layer
> > must become a SHAPEfile.
> > So I wrote a program in VB. But VB doesn't support a MAPEXPORT command.
> > So I started using scripts.
> > And here is the problem :
> > The MAPEXPORT4 command is not working properly because when i export a
> > polyline containing arcs the shapefile containes several duplicated
> points.
> > In MAP 5 the MAPEXPORT command (command line driven) works well for
point
> en
> > line SHAPEfiles but not for polygon SHAPEfiles. They are empty.
> > In MAP 6 the MAPEXPORT command (command line driven) does not support
the
> > export of Object Data to the SHAPEfile. It does when you use a profile,
> but
> > i'm not going to make a profile for every layer i have to export .... I
> > need to be variable.
> >
> > So, i have 3 questions :
> >
> > 1. When is Autodesk going to make a MAPEXPORT command in VBA or VLISP ?
> > 2. When is Autodesk going to create good and stable commands fo the
> command
> > line ?
> > 3. Does anybody have a solution for this problem ?
> >
> > Thanx in advance...
> >
> >
> > Stefan
> >
> >
>
>
Message 6 of 10
Anonymous
in reply to: Anonymous

Sorry, wrote a little mistake :

 

try the following :

 

filedia 0

cmddia 0

-mapexport

 

the "-" sign is important ...

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
Stefan. I am not sure what you are doing wrong but MAPEXPORT in Map6 does
support OD tables when exporting to shapefile (even without profiles). The OD
tables as well as other properties, SQL links and attributes are found under
the DATA tab>>>"Select Attributes" of the MapExport dialog box. Also
the fact that every layer must become a shapefile is not an AutoDesk
limitation, it is just the way that ESRI shapefiles are handled. ESRI
shapefiles do not recognize layers as AutoCAD does, it only recognizes points,
polygons, and lines. If your drawing contains primarily many polygons, it may
be more efficient to attach an OD table containing a unique layer name to each
groups of polygons belonging to that layer. You can then send out all the
polygons in one export process and the shapefile layers will be defined by
field name in OD table.
Message 7 of 10
Anonymous
in reply to: Anonymous

Stefan,
I just tried exporting a dwg to a shp file from the command line like this.
As long as you have a profile saved (.epf file) and call it at the correct
place in the -mapexport command it works. Either you have a bad install of
Map6 or there is something else wrong in your program.

Murph


"Stefan" wrote in message
news:4F32CAB2665A648F4E76E2000A81D623@in.WebX.maYIadrTaRb...
Sorry, wrote a little mistake :

try the following :

filedia 0
cmddia 0
-mapexport

the "-" sign is important ...
Message 8 of 10
Anonymous
in reply to: Anonymous

Murph,

I know it works with profiles, but i cannot make 50+ profiles every time
before I'm going to export to SHAPEfile. It should be done like it was in
MAPEXPORT of MAP4 and MAP5, but these don't work properly...

I think there will be only one way to make it work :
write a program myself to make a SHAPEfile.
(and sell it to Autodeks ;-))) )

Thanx anyway for your time ...

stefan


"Murph" schreef in bericht
news:601D54E7C7BFB709A792C89CAC469589@in.WebX.maYIadrTaRb...
> Stefan,
> I just tried exporting a dwg to a shp file from the command line like
this.
> As long as you have a profile saved (.epf file) and call it at the correct
> place in the -mapexport command it works. Either you have a bad install of
> Map6 or there is something else wrong in your program.
>
> Murph
>
>
> "Stefan" wrote in message
> news:4F32CAB2665A648F4E76E2000A81D623@in.WebX.maYIadrTaRb...
> Sorry, wrote a little mistake :
>
> try the following :
>
> filedia 0
> cmddia 0
> -mapexport
>
> the "-" sign is important ...
>
>
>
>
Message 9 of 10
hiramjr
in reply to: Anonymous

I know exactly what you're talking about because we have the same problem here. We run routines (lisp/vba) to export objects + object data to shape files. All worked fine until the migration to 2004. Now, for reasons unknown, a very important prompt (i.e. od table name) is missing from -mapexport.

I agree that going to a saved profile is not the answer. Going backwards to mapexport4 isn' the answer either because sometimes it works and sometimes it doesn't. Putting the prompt back into the command is the right answer.

oh well...

Eric Smallwood
Message 10 of 10
frankin4
in reply to: Anonymous

I too have issues with closed polygons in Map. The first of which was sometimes easily(?) solved. When you make a polyline and force it to close (c) it doesn't REALLY close. For screen appearance sake it will draw the required segment to close. When you export out the "closed" polygon, it will not show. Long story short, you may need to rethink your polygon creation process. Run all the cleaning options with the appropriate tolerances. The other issue is island polygons, which still don't seem to work quite right. I usually end up exporting to a coverage, clean in ArcInfo, and export out to shape.

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

Post to forums  

”Boost