CAD Forums > Vertically Challenged

Mapimport KML

(1/1)

MSTG007:
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: ---(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)
--- End code ---

ronjonp:
Look into GETFILED.
https://autode.sk/2HtnFp1

MSTG007:
Thanks Ron! Got it. Works like I want it to! Thank you!

ronjonp:

--- Quote from: MSTG007 on August 27, 2019, 10:09:36 AM ---Thanks Ron! Got it. Works like I want it to! Thank you!

--- End quote ---
Glad to help :)

Navigation

[0] Message Index

Go to full version