请各位高手帮我看看,为什么我指定四个圆中心放置点会走位 (我希望达到的效果是,不论我指定任何放置点都是四个圆的中心) 附上测试源码 (defun c:22() (vl-load-com) (setq mv_osm(getvar "osmode")) (setvar "osmode" mv_osm) (command "ucs" "w") (setq ad_dim_sel (ssget)) (dim_box) (initget 1) (setq cen_pt (getpoint "\n请指定四个圆中心放置点:")) (command "ucs" "o" cen_pt) (setvar "osmode" 0) (command "circle" box_xdis22 5) (command "circle" box_xdis_22 5) (command "circle" box_ydis22 5) (command "circle" box_ydis_22 5) );defun ;;; ;;; ;;; (defun dim_box() (setq n 10) (setq minx0 1e6 miny0 1e6 maxx0 -1e6 maxy0 -1e6) (setq i 0) (repeat (sslength ad_dim_sel) (setq end (ssname ad_dim_sel i)) (setq end_data (entget end)) (Min_Max) (setq i(1+ i)) ) (if (= n nil)(setq n 0)) (setq m1x(fix (- minx0 n)) m2x (fix (+ maxx0 n)) m1y (fix (- miny0 n)) m2y (fix (+ maxy0 n)) pmin (list m1x m1y) pmax (list m2x m2y)) (setq GetBox-midpt (polar pmin (angle pmin pmax) (/(distance pmin pmax) 2.0))) (setq box_p2(list(car GetBox-midpt)(cadr pmin))) (setq box_p4(list(car pmin)(cadr GetBox-midpt))) (setq box_xdis(distance pmin box_p2)) (setq box_ydis(distance pmin box_p4)) (setq box_xdis_22(polar GetBox-midpt pi (+ box_xdis 0))) (setq box_xdis22(polar GetBox-midpt 0 (+ box_xdis 0))) (setq box_ydis_22(polar GetBox-midpt (* 0.5 pi) (+ box_ydis 0))) (setq box_ydis22(polar GetBox-midpt (* 1.5 pi) (+ box_ydis 0))) );defun ;;; ;;; ;;;求选集是大外形坐标 (defun Min_Max() (vla-getboundingbox(vlax-ename->vla-object end) 'minp 'maxp) (setq minp (vlax-safearray->list minp) maxp (vlax-safearray->list maxp)) (setq minx (car minp) maxx (car maxp) miny (cadr minp) maxy (cadr maxp)) (if (> minx0 minx) (setq minx0 minx)) (if (> miny0 miny) (setq miny0 miny)) (if (< maxx0 maxx) (setq maxx0 maxx)) (if (< maxy0 maxy) (setq maxy0 maxy)) );defun |