cadlisp获取当前视图坐标 30
对于随意一场cad图纸,打开特性面板后,可以看到视图选项的圆心坐标以及下面的宽度,这些参数如何用lisp程序提取出来...
对于随意一场cad图纸,打开特性面板后,可以看到视图选项的圆心坐标以及下面的宽度,这些参数如何用lisp程序提取出来
展开
2个回答
展开全部
复制下面的脚本到命令行回车即可加载,输入pldd,程序会提示选择pline,选择pline后会打印所有的三维坐标
(defun c:pldd (/ wb cc ss1 aa pts bhbz ent)
(setq ent (car (entsel "\n请选择PLINE")))
(setq wb (entget ent) cc nil bhbz (cdr (assoc 70 wb)) )
(cond
((= (cdr (assoc 0 wb)) "POLYLINE")
(setq ss1 (entnext ent))
(while (/= ss1 nil)
(setq aa (entget ss1))
(if (= (cdr (assoc 0 aa)) "VERTEX") (progn
(setq aa (cdr (assoc 10 aa)))
(if (/= aa nil) (progn
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(if (= cc nil)
(setq pts aa)
)
(setq cc (cons aa cc))
))
(setq ss1 (entnext ss1))
)
(setq ss1 nil)
)
)
(if (= bhbz 1)
(setq cc (cons pts cc))
)
)
((= (cdr (assoc 0 wb)) "LWPOLYLINE")
(setq wb (member (assoc 10 wb) wb))
(while (assoc 10 wb)
(setq aa (cdr (assoc 10 wb)))
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(if (= cc nil)
(setq pts aa)
)
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(setq cc (cons aa cc) wb (cdr wb))
(if (assoc 10 wb)
(setq wb (member (assoc 10 wb) wb))
)
)
(if (= bhbz 1)
(setq cc (cons pts cc))
)
)
((= (cdr (assoc 0 wb)) "SPLINE")
(setq wb (member (assoc 11 wb) wb))
(while (assoc 11 wb)
(setq aa (cdr (assoc 11 wb)))
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(if (= cc nil)
(setq pts aa)
)
(setq cc (cons aa cc) wb (cdr wb))
(if (assoc 11 wb)
(setq wb (member (assoc 11 wb) wb))
)
)
(defun c:pldd (/ wb cc ss1 aa pts bhbz ent)
(setq ent (car (entsel "\n请选择PLINE")))
(setq wb (entget ent) cc nil bhbz (cdr (assoc 70 wb)) )
(cond
((= (cdr (assoc 0 wb)) "POLYLINE")
(setq ss1 (entnext ent))
(while (/= ss1 nil)
(setq aa (entget ss1))
(if (= (cdr (assoc 0 aa)) "VERTEX") (progn
(setq aa (cdr (assoc 10 aa)))
(if (/= aa nil) (progn
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(if (= cc nil)
(setq pts aa)
)
(setq cc (cons aa cc))
))
(setq ss1 (entnext ss1))
)
(setq ss1 nil)
)
)
(if (= bhbz 1)
(setq cc (cons pts cc))
)
)
((= (cdr (assoc 0 wb)) "LWPOLYLINE")
(setq wb (member (assoc 10 wb) wb))
(while (assoc 10 wb)
(setq aa (cdr (assoc 10 wb)))
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(if (= cc nil)
(setq pts aa)
)
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(setq cc (cons aa cc) wb (cdr wb))
(if (assoc 10 wb)
(setq wb (member (assoc 10 wb) wb))
)
)
(if (= bhbz 1)
(setq cc (cons pts cc))
)
)
((= (cdr (assoc 0 wb)) "SPLINE")
(setq wb (member (assoc 11 wb) wb))
(while (assoc 11 wb)
(setq aa (cdr (assoc 11 wb)))
(if (= (length aa) 2)
(setq aa (list (car aa) (cadr aa) 0.0) )
)
(if (= cc nil)
(setq pts aa)
)
(setq cc (cons aa cc) wb (cdr wb))
(if (assoc 11 wb)
(setq wb (member (assoc 11 wb) wb))
)
)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询