;;;===============================================================
;;;c:bgj 计算最小配筋率
;;;===============================================================
(defun c:mini_zxpjl ( / old_cmd  h1 as1 fy1 fcm n 
                  bgj
             )

(defun bgj ( h1 ;计算板厚
             as1 ;单向板配筋面积 <用于求分布筋面积
             fy1 ;钢筋强度等级1<一级>,2<二级>,3<三级>,4<四级>
             fcm ;砼强度等级,20 25 30 35 40 45 50 55 60 65 70 75 80>
                     / pt data_bgj b1 fy nb nd ft fe fc
					   tc1 tc2 tc3 tc4 tc5 tc6 tc7 tc8 tc9 hh 
		   )
  (setq data_bgj
       (list (list "一级" 210 "130")
	         (list "二级" 300 "131")
	         (list "三级" 360 "132")
	         (list "四级" 400 "134")
             (list "C20" 1.1 0.2)
	         (list "C25" 1.27 0.25)
	         (list "C30" 1.43 0.25)
	         (list "C35" 1.57 0.25)
	         (list "C40" 1.71 0.3)
	         (list "C45" 1.8 0.3)
	         (list "C50" 1.89 0.3)
	         (list "C55" 1.96 0.3)
	         (list "C60" 2.04 0.35)
	         (list "C65" 2.09 0)
	         (list "C70" 2.14 0)
	         (list "C75" 2.18 0)
	         (list "C80" 2.22 0)
	  )
	  layer_bgj (list "板配筋数据" "3")
      h1 (if h1 h1 100)
      as1 (if as1 as1 0)
      fy1 (if fy1 fy1 "二级")
      fcm (if fcm fcm "C25")
  )
  (mapcar 'set '(fy1 fy nb) (assoc fy1 data_bgj))
  (mapcar 'set '(fcm ft fc) (assoc fcm data_bgj))
  (mai_get_scale)
  (mai_set_style (caddr maitextname) nil)
  (setq b1 1000
        tc1 (/ (* 45 ft) fy)
        tc2 0.2
        tc3 (max tc1 tc2)
        tc4 (rtos (/ (* tc3 b1 h1) 100) 2 0)
        tc3 (rtos tc3 2 3)
        tc5 (* 0.15 as1)
        tc6 (* 0.0015 b1 h1)
        tc5 (rtos (max tc5 tc6) 2 0)
        tc7 (rtos (* 0.001 b1 h1) 2 0)
        tc8 (rtos (* 0.01 fc b1 h1) 2 0)
        tc9 (rtos (* 0.0015 b1 h1) 2 0)
        pt (getpoint "\n点取标注位置:")
        hh (* mai_scale (cadddr maitextname))
  )
  (apply 'mai_create_layer layer_bgj)
  (foreach nb
     (list (strcat "输入板厚=" (rtos h1 2 3) "mm 板最小配筋率=" tc3 "% 钢筋强度等级:" fy1 " 砼强度等级:" fcm)
	       (strcat "板最小配筋面积=" tc4 "mm^2/m 板最小分布筋面积=" tc5 "mm^2/m")
	       (strcat "板有温度、收缩要求时跨中分布面面积=" tc7 "mm^2/m 人防核爆时最小配筋=" tc8 "mm^2/m")
	       (strcat "板卧置于地基时最小配筋率=0.15% 板配筋面积=" tc9 "mm^2/m")
     )
     (mai_draw_text "bl" pt hh 0 nb (caddr maitextname) nil 0.8)
	 (setq pt (mai_point_offset pt 0 (* -1.5 hh)))
  )
)


  (mai_start nil)
  (if (not mai_bgj_data) (setq mai_bgj_data (list 100 0 "二级" "C25")))
  (mapcar 'set '( h1 as1 fy1 fcm) mai_bgj_data)
  (setq n (mai_dcl_model1
	          (list (list "-2"))
	          0 
			  "【计算最小配筋率】"
		      (list 1 1 40 0.1 -15 nil nil)
	          (list "参数:"
	                (list "计算板厚:" "real" h1)
	                (list "单向板配筋面积<求分布筋面积>:" "real" as1)
	                (list "钢筋强度等级:" (list "RADIO" "一级" "二级" "三级" "四级") fy1)
	          )
              (list "砼强度等级:" 12 14
			       (list "C20" "C25" "C30" "C35" "C40" "C45" "C50" "C55" "C60" "C65" "C70" "C75" "C80")
				   (list fcm)
			  )
			  nil
	      )
   )
   (if n
      (progn
       (setq fcm (caddr n)
	         h1 (cadr n)
			 as1 (cadr h1)
			 fy1 (caddr h1)
			 h1 (car h1)
             mai_bgj_data (list h1 as1 fy1 fcm)
	   )
       (apply 'bgj mai_bgj_data)
	  )
   )
  (mai_end)
)

