我尝试使用暂停,但这只适用于一个“点击事件”。
我累了(命令pause pause),它允许我选择动态块,单击旋转夹点并旋转到一个新角度,然后继续。但是如果我也需要翻过障碍,我就太幸运了。
是否有一种方法可以让LISP让用户进行一些选择,在窗口中四处单击,然后在完成后点击“重新启动”(继续运行)LISP的特定键?
格伦 当命令处于活动状态时,存在以下情况:
(defun c:zmblk (/ *error* StrBrk _3dPoint *ACAD BPNT DOC DPNT ELST FILE
LST MAXP MINP NL OFILE PTS UFLAG)
(vl-load-com)
(defun *error* (msg)
(and uFlag (vla-EndUndoMark doc))
(and oFile (close oFile))
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **")))
(princ))
(defun StrBrk (str chrc / pos lst)
(while (setq pos (vl-string-position chrc str))
(setq lst (cons (substr str 1 pos) lst)
str (substr str (+ pos 2))))
(reverse (cons str lst)))
(setq _3dPoint (lambda (x) (vlax-3d-point (trans x 1 0))))
(if (setq file (getfiled "Select Text File" (if *load *load "") "txt" )
(progn
(setq doc (vla-get-ActiveDocument (setq *acad (vlax-get-acad-object)))
uflag (not (vla-startUndoMark doc)))
(setq *load file ofile (open file "r"))
(while (setq nl (read-line ofile))
(princ nl)
(setq lst (cons (car (StrBrk nl 9)) lst)))
(setq ofile (close ofile))
(if (setq elst (vl-remove-if 'null
(mapcar 'handent
(mapcar (function (lambda (x) (substr x 2))) (reverse lst)))))
(foreach Obj (mapcar 'vlax-ename->vla-object elst)
(vla-getBoundingBox Obj 'Minp 'Maxp)
(setq pts (mapcar 'vlax-safearray->list (list Minp Maxp)))
(vla-ZoomCenter *acad
(vlax-3D-point (polar (car pts) (apply 'angle pts) (/ (apply 'distance pts) 2.))) 400.)
(if (and (setq bPnt (getpoint "\nPick Base point: "))
(setq dPnt (getpoint bPnt "\nPick Destination: ")))
;;(vl-cmdf "_.move" (vlax-vla-object->ename obj) "" bPnt dPnt))))
(vl-catch-all-apply 'vla-move (list obj (_3dPoint bPnt) (_3dPoint dPnt))))))
(setq uflag (vla-EndUndoMark doc)))
(princ "\n<< No File Selected >>"))
(princ))
告诉我。。。
我的储藏室里还有一些盒子,里面有很多我用lisp写的东西。。。。
Tell me...
I still have some boxes with a lot of the stuff I wrote in lisp on my storage room....
页:
1
[2]