你好
我刚刚编写了我的第一个LISP程序。多亏了李·麦克,我才有时间去上班。但是我知道我需要一些帮助。。。
除了allready包含的内容(是的,我知道,可以做得更好),我想:
1.将块名作为文本包含在块内
2.将偏移线的长度及其对角线(A-C)添加到属性。
这容易做到吗?
谢谢
马格纳斯
-
- (defun c:glas ()
-
- (setq A (getpoint "Pick point A: "))
- (setq B (getpoint "Pick point B: "))
- (setq C (getpoint "Pick point C: "))
- (setq D (getpoint "Pick point D: "))
- ;(command "text" A 100 0 A)
- ;(command "text" B 100 0 B)
- ;(command "text" C 100 0 C)
- ;(command "text" D 100 0 D)
- (setq E (command "pline" A B C D))
- (command "close")
- ;(setq rad (angle A B))
- (command "rectangle" A C)
-
- (command "offset" 10 (entlast) (getpoint "Pick point: "))
- (command "exit")
-
- (cond ( (not (setq ss (ssget '((0 . "~VIEWPORT"))))))
- ( (while
- (progn
- (setq bNme (getstring t "\nSpecify Block Name: "))
- (cond ( (not (snvalid bNme))
- (princ "\n** Invalid Block Name **"))
- ( (tblsearch "BLOCK" bNme)
- (princ "\n** Block Already Exists **"))))))
- ( (not (setq i -1 pt (getpoint "\nSpecify Base Point: "))))
- (t (entmake (list (cons 0 "BLOCK") (cons 10 pt) (cons 2 bNme) (cons 70 0)))
- (while (setq ent (ssname ss (setq i (1+ i))))
- (entmake (entget ent))
-
- (and (= 1 (cdr (assoc 66 (entget (setq sub ent)))))
- (while (not (eq "SEQEND" (cdr (assoc 0 (entget (setq sub (entnext sub)))))))
- (entmake (entget sub)))
- (entmake (entget sub)))
-
- (entdel ent))
- (entmake (list (cons 0 "ENDBLK") (cons 8 "0")))
- (entmake (list (cons 0 "INSERT") (cons 2 bNme) (cons 10 pt)))))
- (princ))
- )
- (princ)
|