-
1:初心者
:
2025/04/08 (Tue) 23:12:03
-
寸法値の疑尺を確認したいのですが寸法値で<>を含まないものを選択して
その寸法をすべて(補助線や寸法文字、矢印など)赤色をつけることは可能なのでしょうか?
そのようなlispは可能なのでしょうか?
寸法値で <>+hole などは除外したいです
-
2:Hamu
:
2025/04/09 (Wed) 10:02:02
-
(defun c:ChangeDimColor ()
(vl-load-com)
(setq ss (ssget "X" '((0 . "DIMENSION")))) ;図面上の全ての寸法オブジェクトを検索
(setq i 0)
(command "undo" "be")
(repeat (sslength ss)
(setq ent (ssname ss i))
(setq data (entget ent))
(setq text (cdr (assoc 1 data))) ;上書き文字抽出
(if (and text (not (= text "")) (not (vl-string-search "<>" text))) ; 空文字と<>を含む文字列以外なら
(command "dimoverride" "dimclre" "1" "dimclrd" "1" "dimclrt" "1" "" ent "") ;色を赤色へ
)
(setq i (1+ i))
)
(command "undo" "e")
(princ)
)
-
3:初心者
:
2025/04/09 (Wed) 16:45:32
-
ありがとうございます。
思った通りの動作でした。
助かりました。