Author Topic: How can I export ESRI shape file in autodesk map use atuolisp?  (Read 1949 times)

0 Members and 1 Guest are viewing this topic.

guohq

  • Newt
  • Posts: 84
I want to export ESRI shape file in autodesk map 2005 not use mapexprot tool . How can I define some functions to do it ?

Didge

  • Bull Frog
  • Posts: 211
Re: How can I export ESRI shape file in autodesk map use atuolisp?
« Reply #1 on: March 23, 2009, 10:17:10 AM »
Guohq,

I'm not aware of any internal functions controlling 3Dmap's export capabilities, but here's a snippet that will allow you to bypass the mapexport dialogue. This coding utilises an export profile named "PROFILE.EPF", feel free to replace this with whatever export profile best suits your requirements.

Good Luck.
Didge.

Code: [Select]
;****************************************************************************
; ESRI-EXPORT   - Command to silently export a shape file from 3D Map 2009. *
; ===========     Didge.                                                    *
;****************************************************************************
(defun c:ESRI-EXPORT (/ tmp oldcmd oldfdia)
   (if (if esripath
(setq tmp (getfiled "Specify Destination Filename" esripath "shp" 1))
(setq tmp (getfiled "Specify Destination Filename" "" "shp" 1))
      )
    (progn
      (setq esripath tmp)
      (setq oldcmd (getvar "CMDECHO")) (setvar "CMDECHO" 0)
      (setq oldfdia (getvar "FILEDIA")) (setvar "FILEDIA" 0)
      (if (findfile esripath)
        (command "-MAPEXPORT" "SHP" esripath "O" "Y" "PROFILE.EPF" "_P")
        (command "-MAPEXPORT" "SHP" esripath      "Y" "PROFILE.EPF" "_P")
      )
      (setvar "FILEDIA" oldfdia)
      (setvar "CMDECHO" oldcmd)
    )
  )
  (princ)
)
Think Slow......

guohq

  • Newt
  • Posts: 84
Re: How can I export ESRI shape file in autodesk map use atuolisp?
« Reply #2 on: March 24, 2009, 08:21:10 PM »
Thank you very much! I have achieved my purpose.

By the way ,when I export shape file, how can I edit the table structure of shape file?

For example ,if the type of a filed is string,  the default long of the filed is 254, how can I set the number to 20?