

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



; 箍筋保留[mini_gjbl].lsp

(defun c:mini_gjbl ( / old_cmd s21000 SS lock eb
						TCCAD-加密区	TCCAD-非加密区
						TCCAD-删除配箍值	TC_TEXT s1
			)
	(mini_start nil)
	(mai_last_com "mini_gjbl")
	(mai_get_scale)
	(setq lock (mai_unlock_alllayer))
	(mai_erase_ent_in_lay "25000,28000,22000,24000")
	(or (setq s21000 (ssget "x" '( (0 . "TEXT") (8 . "21000"))))
		(progn
			(princ "\n图层 【 21000 】上没有文字实体。")
			(exit)
		)
	)
	(foreach eb (mai_ssget_2_list s21000)
		(setq eb (strcase (mai_dxf 1 eb)))
		(if (wcmatch eb "*-*-*")
			(entdel eb)
			(princ (strcat "\n没有修改数据:" eb))
		)
	)
	(or tccd-配箍形式 (setq tccd-配箍形式 "1"))
	(setq
		tccd-配箍形式
			(mai_ukword
				1
				"1 2 3 4 5"
				"\n配箍形式***********<1>*100/200/<2>*100/150/<3>单一间距"
				tccd-配箍形式
			)
		tccad-txt
			(mai_ureal
				1
				""
				"\n<1>请输入要删除的箍筋值"
				tccad-txt
			)
	)
	(mai_create_layer (rtos tccad-txt 2 3) "2")
	(setq ss (ssget (list '(0 . "*TEXT") '(8 . "21000") (cons 1 "G*"))))
	(foreach s1 (mai_ssget_2_list ss)
		(setq
			tc_text (mai_dxf 1 s1)
			tc_text (vl-string-translate "-" " " tc_text)
			tc_text (read (strcat "(" (vl-string-translate "G" " " tc_text) ")"))
		)
		(cond
			(	(= tccd-配箍形式 "1")
				(mapcar 'set '( tccad-加密区 tccad-非加密区) tc_text)
				(setq tccad-删除配箍值 (/ tccad-加密区 (if (> tccad-加密区 (* 2 tccad-非加密区)) 2 1)))
			)

			(	(= tccd-配箍形式 "2")
				(mapcar 'set '( tccad-加密区 tccad-非加密区) tc_text)
				(setq tccad-删除配箍值 (/ tccad-加密区 (if (> tccad-加密区 (* 1.5 tccad-非加密区)) 1.5 1)))
			)

			(	(= tccd-配箍形式 "3")
				(setq tccad-删除配箍值 (apply 'max (vl-remove-if-not '(lambda (x) (numberp x)) tc_text)))
			)
		)
		(if (>= tccad-txt tccad-删除配箍值)
			(command "_.chprop" s1 "" "la" (rtos tccad-txt 2 3) "")
		)
	)
	(mai_purge_all)
	(mai_relock_layers lock)
	(mai_end)
)
