假如我们把地下室和每层平面图各自设置一个用户坐标(用户坐标才是大坐标),就可以大坐标直接放线了,现在的CAD放线软件都能识别多个UCS,是不是很爽
- (defun vxs (e / i v lst)
- (setq i -1)
- (while
- (setq v (vlax-curve-getpointatparam e (setq i (1+ i))))
- (setq lst (cons v lst))
- )
- (reverse lst)
- )
- (defun c:zb123 (/ p1 p2 p3 p4 yuandian fxdian xbzx bz UCSColl origin xAxisPnt yAxisPnt ucsObj)
- (VL-LOAD-COM)
-
- (setq xbzx (getstring "\n请输入新坐标系的名称:") )
- (setq bz(getvar "osmode"))
-
- ;(command "_.pline" '(0.0000 0 0) '(100.000 0 0) "")
- (setq p1 (getpoint "\n请点击广州坐标源点1: "))
- (setq p2 (getpoint "\n请点击广州坐标源点2: "))
- (command "_.pline" '(0.0000 0 0) (list (* 1000(distance p1 p2)) 0 0) "")
- (setq p3 (getpoint "\n请点击施工坐标源点1 :"))
- (setq p4 (getpoint "\n请点击施工坐标源点2 :"))
- (command "_.align" (entlast) "" p1 p3 p2 p4 "" "n" )
- (setq yuandian (car (vxs (entlast))))
- (setq fxdian (cadr (vxs (entlast))))
- ;(setq yuandian (cdr(assoc 10 (entget(entlast)))) )
- ;(setq fxdian (cdr(assoc 11 (entget(entlast)))) )
- (setvar "osmode" 0)
- (vl-cmdf "_.ucs" "3p" yuandian fxdian "" )
- ;(vl-cmdf "_.ucs" "ob" (mapcar '* '(0.5 0.5 ) (mapcar '+ yuandian fxdian) ) )
- (command "_.ucs" "na" "s" xbzx )
- (setvar "osmode" bz)
- ;(command "_.plan" "c")
- (entdel (entlast))
- (command "_.ucs" "w" )
- (princ)
- )
|