Select to view content in your preferred language

Problem Importing Shapes to CAD

780
1
05-29-2013 04:36 AM
AaronAmbrose
Deactivated User
Hi all,

I am having a major problem importing my collected shapefiles into AutoCAD.
I use AutoCAD Map 2002, and I know all about importing. I need to import thousands of files and have written lisp routines to do so. To use any other software would add a step which will add huge time wasting. So I want to know what is wrong with my set up.

Often, suddenly the set of files (consisting of about a dozen different feature layers) won't import properly. That is, only a couple of one feature will import and say - one record from another feature. If I do them one at a time, I can usually get one record from all the different shapes/features, otherwise, as soon as it hits a bad one, it stops.

-The CAD files are clear of any object data - therefore, it is not a conflict of tables.
-There is no error message when I perform the process.
-I check the dbf file with a simple editor/viewer and I see that there are several records.
I can use a crappy 3rd party converter and all records transfer (but all my numerical values get expressed to multiple precisions and Boolean values come out different - which would require tones of lisp re-writing - and that extra software step)
-I have tried importing the shapes as both points with data and as predefined blocks; same result.

What on earth could cause this?

The temporary fix is to recreate all my shapefiles with ArcPad's 'new shapefile' feature (I keep my existing VBS script and APL files).
But then, suddenly the problem comes again.

Is it something to do with deleted records in the files or something?
Would a newer version of AutoCAD Map solve this problem?
Tags (3)
0 Kudos
1 Reply
AaronAmbrose
Deactivated User
I think I have found the cause, but I still have an issue.
These bad files seem to come about when I use a little routine that I have for deleting all the features in a map.
Below is the code for the sub function: The main Sub merely loops thru all of the shapes and sends the name of the shape file to this sub-routine.
So, somehow this is causing shape file records to be that they don't import into my AutoCAD Map 2002.
And again, you check the dbf files themselves and all the expected records are there, but they won't import!

And I really don't want to get rid of this master 'delete' sub.

So, can anyone tell me why this function is causing this problem, or better yet, what I can alter in it to stop causing the problem?

...btw, if I delete a feature manually with ArcPad's delete feature function, no issues!

Function Getridothem(shape)
dim objRS, objLyr
Set objLyr = Map.Layers(shape)
if (objLyr is Nothing) then
Else
  objLyr.Editable = True
  set objRS = objLyr.records
  If Not objRS.recordcount = 0 Then
   objRS.Movefirst
   Do while not objRS.eof
    objRS.Delete
    objRS.MoveNext
   Loop
  End If
  Set objRS = Nothing
End if
set objLyr = Nothing
End Function
0 Kudos