;++++++++++++++++++++++++++++++++
;+  画单根箍筋-拉筋[mini_dgkj]  +
;++++++++++++++++++++++++++++++++

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

(defun c:mini_dgkj ( / old_pwidth old_cmd old_osmode old_filletrad p1 p2 p3 p4 scale ang ) ;s4
	(mini_start nil)
	(mai_last_com "mini_dgkj")
	(mai_get_scale)
	(setq old_osmode (getvar "osmode"))
	(setq old_pwidth (getvar "plinewid"))
	(setvar "osmode" 4)
	(and
		(setq p1 (getpoint "\n画单根箍筋(拉筋)第一点:<退出>"))
		(setq p2 (getpoint p1 "\n画单根箍筋(拉筋)第二点:<退出>"))
	)
	(or p2 (exit))
	(setq scale (/ 100. mai_scale2))
	(mapcar 'set '(p1 p2 p3 p4) (mapcar 'car (car (mai_data_expand2plines (list p1 p2) (* scale 12.5) (* scale 12.5)))))
	(setq
		ang (angle p1 p2)
		old_filletrad (getvar "filletrad")
	)
	(setvar "filletrad" (* scale 12.5))
	(apply 'mai_create_layer mai_rein_layer)
	(setvar "plinewid" (* mai_rein_width scale))
	(mai_entmake "lwpolyline" (list (polar p1 ang (* scale 22.5)) p1 p4 p3 p2 (polar p2 ang (* scale -22.5))))
	(command "_.fillet" "p" "l")
	(mai_end)
)
