;+++++++++++++++++++++++++++++++
;+  转角放射筋[mini_zjfsj]     +
;+++++++++++++++++++++++++++++++

(apply
	'(lambda( / x )
		(or mai_pile_text
			(not (setq x (mai_panel_search "谜你结构专业设置文件[mini_jiegou_config].lsp")))
			(load x)
		)
	)
	nil
)


(defun c:mini_zjfsj ( / old_pwidth old_cmd p1 cen tmp p5 p5end
						p6 p6end ang pi2 pi4 rebarlength number
					)
	(mini_start nil)
	(mai_last_com "mini_zjfsj")
	(mai_get_scale)
	(setq
		old_pwidth (getvar "plinewid")
		pi2 (* 0.5 pi)
		pi4 (* 0.2 pi)
		rebarlength 1500
		number 5 ;单数
		number (1+ (fix (/ number 2)))
	)
	(or mai_rein_l_layer (setq mai_rein_l_layer (list "BDJ-L" "2")))
	(or (> number 2) (setq number 3))
	(or pi4 (setq pi4 (* (1- number) (/ pi number 4))))
	(setvar "plinewid" (* mai_rein_width (/ 100 mai_scale2)))
	(and
		(setq cen (getpoint "\n输入转角放射筋圆心:<退出>"))
		(setq p1 (getpoint cen "\n输入转角放射筋方向:<退出>"))
	)
	(or p1 (exit))
	(apply 'mai_create_layer mai_rein_l_layer)
	(setq
		ang (angle cen p1)
		p5 (polar cen ang 200)
		p6 (polar p5 ang rebarlength)
		ang (- ang pi2)
		tmp (* mai_scale2 (if (> pi ang 0) -2 2))
		p5end (polar p5 ang tmp)
		p6end (polar p6 ang tmp)
		p1 (vlax-ename->vla-object (mai_entmake "lwpolyline" (list p5end p5 p6 p6end)))
		cen (vlax-3D-point cen)
	)
	(foreach tmp (list pi4 (- pi4)) (vla-ArrayPolar p1 number tmp cen))
	(mai_end)
)
