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


(defun c:mini_jcjc ( / old_cmd entname count num1 num2 rnfpos1 rnfpos2 ss text )
	(mini_start nil)
	(mai_last_com "mini_jcjc")
	(mai_get_scale)
	(setq ss
			(mai_select_first
				(list (cons 0 "TEXT") (cons 8 (strcat (car mai_rein_text) ",水平钢筋,垂直钢筋")) (cons 1 "*+*"))
				"选择要钢筋级差是否超过2级文本实体:<退出>"
				"所选择的范围内没有符合条件的pkpm平法钢筋文本实体."
			)
		count 0
	)
	(command "_.change" ss "" "P" "c" "bylayer" "")
	(foreach entname (mai_ssget_2_list ss)
		(setq
			text (mai_dxf entname)
			rnfpos1 (+ 5 (vl-string-search "%%13" text))
			rnfpos2 (+ 5 (vl-string-search "%%13" text rnfpos1))
			num1
				(strcat
					(chr (vl-string-elt text rnfpos1))
					(chr (vl-string-elt text (1+ rnfpos1)))
				)
			num2
				(strcat
					(chr (vl-string-elt text rnfpos2))
					(chr (vl-string-elt text (1+ rnfpos2)))
				)
		)
		(if (>= (abs (- (atof num1) (atof num2))) 6)
			(progn
				(command "_.chprop" entname "" "c" "6" "")
				(setq count (1+ count))
			)
		)
	)
	(print
		(strcat
			"\n本次操作共处理"
			(itoa count)
			"个钢筋级别相差2级以上的平法文本,并以6号颜色突显。"
		)
	)
	(mai_end)
)
