;++++++++++++++++++
;+  加一级钢筋头[mini_gjt1]  +
;++++++++++++++++++

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

(defun c:mini_gjt1 ( / old_cmd p1 p2 p3 p4 p5 p6 old_line)
	(mini_start nil)
	(mai_last_com "mini_gjt1")
	(mai_get_scale)
	(and
		(setq p1 (entsel "\n加一级钢筋头，选线:<退出>"))
		(setq p2 (mai_select_rein p1))
	)
	(or p2 (exit))
	(setq old_line (car p1))
	(mapcar 'set '(p1 p2) p2)
	(setq p5 (mai_rein_tou p1 p2 (* 0.5 pi) 1))
	(apply 'mai_create_layer mai_rein_layer)
	(mai_entmake "lwpolyline" (list (list (car p5) (cadr p5)) (list (cadr p5) p1 (caddr p5))))
	(mai_gj_flips (entlast) p1 (angle p1 p2) T nil)
	(command "_.pedit" (entlast) "j" old_line "" "w" (* 0.35 mai_scale2) "")
	(mai_end)
)
