TheSwamp
CAD Forums => Vertically Challenged => Topic started by: MSTG007 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.
(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)
-
Look into GETFILED.
https://autode.sk/2HtnFp1
-
Thanks Ron! Got it. Works like I want it to! Thank you!
-
Thanks Ron! Got it. Works like I want it to! Thank you!
Glad to help :)