Author Topic: Mapimport KML  (Read 135 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Water Moccasin
  • Posts: 2393
  • I can't remeber what I already asked! I need help!
Mapimport KML
« on: August 27, 2019, 08:14:38 AM »
I am making a simple (Command "mapimport") routine. I can get everything to work if its with a hard coded file location. I am trying to figure out how to get the command to pop a dialog box to select the file and then proceed as it does when its hard coded.

Hope that makes sense some.

Code: [Select]
(defun c:zta ()

;;Imports KML into CAD and Zooms to Point

;;(command "mapimport" "y" "p") ;; This command allow for the dialog box then after selecting the file, gives an invalid error.
(command "_.-MAPIMPORT" "OGCKML" "W:\\TEST\\KML.kmz" "_y" "W:\\TEST\\KML.ipf" "_p") ;;This command works with a hard coded file location and name.
(ssget "x" '((0 . "point"))) ;;Finds Point
;;(command "zoom" "object" (ssget "x" '((0 . "point"))) "")  ;; Zooms to Point
(command "zoom" "object" "previous" "")
(command "zoom" "scale" "1/50")
(princ)
)

(C:ZTA)
Autodesk Infrastructure Design Suite 2019

ronjonp

  • Needs a day job
  • Posts: 7025
Re: Mapimport KML
« Reply #1 on: August 27, 2019, 09:25:51 AM »
Look into GETFILED.
https://autode.sk/2HtnFp1

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

MSTG007

  • Water Moccasin
  • Posts: 2393
  • I can't remeber what I already asked! I need help!
Re: Mapimport KML
« Reply #2 on: August 27, 2019, 10:09:36 AM »
Thanks Ron! Got it. Works like I want it to! Thank you!
Autodesk Infrastructure Design Suite 2019

ronjonp

  • Needs a day job
  • Posts: 7025
Re: Mapimport KML
« Reply #3 on: August 27, 2019, 10:17:29 AM »
Thanks Ron! Got it. Works like I want it to! Thank you!
Glad to help :)

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC