Re: Можно ли с помощью Лиспа создать или вызвать графическое меню открывания файла
Немного подкорректировал - теперь работает и в русском 2009 автокаде
(defun C:ASCXYZ()
; (setvar "cmdecho" 0)
; (setvar "blipmode" 0)
; (setvar "pdmode" 2)
; (setvar "osmode" 0)
(cond ((not(tblsearch "layer" "Dots" ))
(Command "_Layer" "_N" "Dots" "_l" "Continuous" "Dots" "_C" "_W" "Dots" ""
"_Layer" "_N" "Names" "_l" "Continuous" "Names" "_C" "_R" "Names" ""))
)
(setq masst 1000)
(setq shift 10)
(setq finm (getfiled "select data file:" "D:\\Geo_data\\" "txt" 16))
(setq fiid (open finm "r"))
(command "_layer" "_s" "Dots" "")
(entmake '((0 . "POLYLINE")(62 . 5)(66 . 1)(70 . 8)))
(while (not (eq (setq fistr (read-line fiid )) nil ))
(setq fispsk fistr)
(stranalyze)
(addvrt)
)
(entmake '((0 . "SEQEND")))
(close fiid)
;(addblk)
(command "_layer" "_s" "Names" "")
(setq fiid (open finm "r"))
(while (not (eq (setq fistr (read-line fiid )) nil ))
(setq fispsk fistr)
(stranalyze)
(addblk)
; (princ)
))
(defun stranalyze()
(setq fiksp(read(strcat "(" (vl-string-translate "," " " fispsk) ")")))
(setq coordot (cons 10 (list (*(nth 2 fiksp)masst) (*(nth 1 fiksp)masst) (*(nth 3 fiksp)masst))))
(setq coortxt (cons 10 (list (+(nth 1 coordot)0) (+(nth 2 coordot)0) (+(nth 3 coordot)shift))))
(setq name (cons 1 fistr))
; (princ)
)
(defun addvrt()
(entmake (list '(0 . "VERTEX") '(70 . 32) coordot))
)
(defun addblk()
(entmake (list '(0 . "TEXT") '(40 . 50) coortxt name))
;(command "_text" coortxt 2.5 0 name "" "" "")
);defun