线路、桥的不同层
你好我最近在cadtutor论坛上从Tharwat那里得到了这个Lisp程序的句子。
哇!它很棒,节省了我很多起草时间。
如果我要求对
lisp通过将线、人孔(点)和文本分隔为不同的
层。
谢谢
mhsw。lsp 要将例程中的每个实体分隔为哪些层名称? 您好,很高兴看到您的回复。
说
(1) 管道线到层名称“管道”
(2) 点(人孔)到层名称“人孔”
(3) 文字到图层名称“textlength”
谢谢
给你,试试,让我知道。
(defun c:MHSW (/ _L _P _T p p1 p2 a ang l i)
;;; =============------------ Tharwat 27. Jan. 2013 -----------=========;;;
;;; Prompt to user to specify Distance between Manholes ;;;
;;; then height of the text and finally to specify start and end points ;;;
(defun *error* (x) (princ "\n *Cancel*"))
(cond ((not (tblsearch "LAYER" "pipe"))
(progn (alert "Layer < pipe > is not found in drawing !!") (exit))
)
((not (tblsearch "LAYER" "manhole"))
(progn (alert "Layer < manhole > is not found in drawing !!") (exit))
)
((not (tblsearch "LAYER" "textlength"))
(progn (alert "Layer < textlength > is not found in drawing !!") (exit))
)
)
(defun _L (j k) (entmakex (list '(0 . "LINE") '(8 . "pipe") (cons 10 j) (cons 11 k))))
(defun _P (p) (entmakex (list '(0 . "POINT") '(8 . "manhole") (cons 10 p))))
(defun _T (p h s a)
(entmakex (list '(0 . "TEXT")
(cons 10 (trans p 1 0))
(cons 11 (trans p 1 0))
'(8 . "textlength")
(cons 40 h)
(cons 1 s)
(cons 50 a)
'(72 . 1)
'(73 . 1)
)
)
)
(if (and (if (progn (initget 6)
(setq *d* (cond ((getdist (strcat "\n Specify distance between Manholes "
(if *d*
(strcat "< " (rtos *d* 2 2) " > :")
" :"
)
)
)
)
(t *d*)
)
)
)
(setq *d* *d*)
nil
)
(if (progn (initget 6)
(setq *h* (cond ((getdist (strcat "\n Specify Text Height "
(if *h*
(strcat "< " (rtos *h* 2 2) " > :")
" :"
)
)
)
)
(t *h*)
)
)
)
(setq *h* *h*)
nil
)
(setq p1 (getpoint "\n specify start point :"))
(setq p2 (getpoint "\n Specify end point :" p1))
)
(progn (setvar 'pdmode 65)
(setq a (angle p1 p2)
ang a
)
(if (and (< (* pi 0.5) ang) (<= ang (* pi 1.5)))
(setq ang (+ pi ang))
ang
)
(mapcar '_P (list p1 p2))
(setq l (distance p1 p2))
(repeat (fix (/ l *d*))
(_L p1 (setq p (polar p1 a *d*)))
(_P p)
(_T (mapcar '(lambda (j k) (/ (+ j k) 2.)) p1 p) *h* (strcat "L= " (rtos *d* 2 1)) ang)
(setq p1 p)
)
(if (> (setq i (rem l *d*)) 0.)
(progn (_L p1 p2)
(_T (mapcar '(lambda (j k) (/ (+ j k) 2.)) p1 p2)
*h*
(strcat "L= "
(if (< i 0.)
(rtos i 2 2)
(rtos i 2 1)
)
)
ang
)
)
)
)
(princ)
)
(princ "\nWritten by Tharwat Al Shoufi")
(princ)
)
太棒了它起作用了,再次感谢
随时欢迎你。 嗨,塔瓦。。。。。。。还有两个问题。
问题1-将点(人孔)放置在特定层中后。我需要将点填充为实心正方形;有可能吗?
问题2-是否可以将点(人孔)更改为实心圆而不是正方形?
谢谢
你好
实心正方形还是实心圆形?
如果是圆,那么圆的直径是多少?如果是多段线,那么正方形的宽度和高度是多少? 嗨,塔瓦。。。。谢谢你的快速回复。
实际上我需要实心正方形和实心圆形。也许Lisp可以提示
供用户选择使用哪一个。;以后可以采用。
至于圆形和正方形的尺寸,有可能改变吗
通过对所选点进行阴影处理,直接从PDIE模式?
谢谢
不能填充点图元。
页:
[1]
2