(defun c:acc ()
(vl-load-com)
(setvar "cmdecho" 0)
(graphscr)
(setq sysvar (getvar "OSMODE"))
(setvar "OSMODE" 16384)
(if (setq sss (ssget '((0 . "line") (8 . "beam,*axis*,*dote*"))))
(progn (setq sss1 (ssget "p" '((8 . "beam"))))
(command "_.select" sss "remove" sss1 "")
(setq sss2 (ssget "p"))
)
)
(setq ptlst (GetInterPoint sss1 sss2))
(qxc ptlst)
(princ)
(setvar "OSMODE" sysvar)
(print"wrightby吴艺深2012-qq:262773362")
)
(COMMAND "LAYER" "MAKE" "X5" "COLOR" "1" "X5" "LT" "continuous" "X5" "")
(COMMAND "LAYER" "MAKE" "gj5" "COLOR" "2" "gj5" "LT" "continuous" "gj5" "")
;;选择集求交点集-网上找的
(defun GetInterPoint (sss1 sss2 / ax_ent_1 ax_ent_2)
(setq n1 0
ptlst (list)
)
(repeat (sslength sss1)
(setq ax_ent_1 (vlax-ename->vla-object (ssname sss1 n1))
n1 (1+ n1)
)
(setq n2 0)
(repeat (sslength sss2)
(setq ax_ent_2 (vlax-ename->vla-object (ssname sss2 n2))
n2 (1+ n2)
)
(setq ipt
(vlax-variant-value (vla-intersectwith ax_ent_1 ax_ent_2 0))
)
(if (> (vlax-safearray-get-u-bound ipt 1) 0)
(progn
(setq ipt (VLAX-SAFEARRAY->LIST ipt))
(while (> (length ipt) 0)
(setq ptlst (cons (list (car ipt) (cadr ipt) (caddr ipt)) ptlst)
ipt (cdddr ipt)
)
);endwhile
);endprogn
);endif
);endrepeat
);endrepeat
ptlst
)
(defun wr_dj ( pa pb / );by wuyishen
(if pa
(progn
(setq gas (/ pi 180)
c_1 (* gas 90)
dis_2 (distance pc pd)
x_dis (- dis_2 50)
angc (angle pd pc)
)
(setq p_c (polar pd angc 50)
 
_1 (polar p_c (+ angc c_1) 150)
 
_2 (polar p_c (- angc c_1) 150)
p_t (polar pd angc x_dis)
 
_3 (polar p_t (+ angc c_1) 250)
 
_4 (polar p_t (- angc c_1) 250)
 
_5 (polar p_t (+ angc c_1) 350)
 
_6 (polar p_t (- angc c_1) 350)
)
(command "pline" p_5 p_3 p_1 p_2 p_4 p_6 "")
(setq djs (entlast))
(command ".chprop" djs "" "LA" "X5" "")
(command "
EDIT" "M" djs "" "W" 40 "")
))
(princ)
)
(defun t3 ( pxx ptt / )
(vl-load-com)
(setq dis 350.0
dis2 550.0
dis3 750.0
)
(command "pline" pxx ptt "")
(setq gj_1 (entlast))
(command ".chprop" gj_1 "" "LA" "gj5" "")
(command "
EDIT" "M" gj_1 "" "W" 40 "")
(setq s_cc (entlast))
(command "_.select" s_cc "")
(setq objs (vla-get-activeselectionset
(vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(vlax-for obj objs (vla-offset obj dis))
(vlax-for obj objs (vla-offset obj (* -1 dis)))
(vlax-for obj objs (vla-offset obj dis2))
(vlax-for obj objs (vla-offset obj (* -1 dis2)))
(vlax-for obj objs (vla-offset obj dis3))
(vlax-for obj objs (vla-offset obj (* -1 dis3)))
(princ)
)
;(t3 pc pd)
(defun qxc (ptlst / );by wuyishen
(setq ni 0
k (length ptlst))
(if (< ni (length ptlst))
(repeat (length ptlst)
(setq 
a (nth ni ptlst))
(setq ni (1+ ni) j ni)
(repeat (- (length ptlst)j)
(setq 
b (nth j ptlst))
(setq pa_x (car pa)
pa_y (cadr pa)
pb_x (car pb)
pb_y (cadr pb)
)
(if
(or
(< pa_x pb_x)
(> pa_y pb_y)
)
(setq pc pa pd pb)
(setq pc pb pd pa)
)
(setq dis_1 (distance pc pd))
(if (< 290 dis_1 510)
(wr_dj pc pd)
)
);endif
(setq j (1+ j))
);repeat
);repeat
);if
(princ)
)