;++++++++++++++++++++++++++++++++
;+  已知钢筋总面积求根数及直径[mini_rein_cale2]  +
;++++++++++++++++++++++++++++++++

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

(defun c:mini_rein_cale2 (/ old_cmd as bend_as ) ;a2

(defun bend_as (as bar / d nn ty)
	(setq
		d 12
		ty (if (= bar 1) "R" "T")
	)
	(while (< d 40)
		(setq
			nn	(cond
					((< d 22) 2)
					((< d 28) 3)
					(4)
				)
			d (+ d nn)
			nn (fix (+ 0.9 (/ as (* pi d d 0.25))))
		)
		(if (< nn 2) (setq nn 2))
		(princ (strcat "  " (itoa nn) ty (itoa d))) 
	) ;while end
) ;defun bend_as end

	(mini_start nil)
	(mai_last_com "mini_rein_cale2")
	(and
		(setq as (getreal "\n已知钢筋总面积求根数及直径,钢筋总面积<平方毫米mm2> = "))
		(bend_as as 2)
	)
	(mai_end)
)
