;+++++++++++++++++++++++++++++++++++++++++++
;+  已知梁宽及钢筋直径求梁顶梁底可配根数[mini_rein_cale3]  +
;+++++++++++++++++++++++++++++++++++++++++++

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

(defun c:mini_rein_cale3 (/ old_cmd bb dd nbb nbt)
	(mini_start nil)
	(mai_last_com "mini_rein_cale3")
	(princ "\n----已知梁宽及钢筋直径求梁顶,梁底可配根数")
	(and
		(setq bb (getreal "\n    输入梁宽<毫米mm>= "))
		(setq dd (getreal "\n输入钢筋直径<毫米mm>= "))
	)
	(or dd (exit))
	(setq
		nbt (if (>= dd 25.) dd 25.)
		nbb (/ (- bb nbt) (+ dd nbt))
		nbt (if (>= dd 20)
				(/ (- bb (* 0.5 dd)) (* 2.5 dd))
				(/ (- bb 20.) (+ dd 30.))
			)
	)
	(princ (strcat "\n   梁顶可配根数 = " (itoa (fix nbt))))
	(princ (strcat "\n   梁底可配根数 = " (itoa (fix nbb))))
	(mai_end)
)
