Vla-put-colormethod
- 構文
- (vla-put-colormethod vla-object acColorMethod)
- 機能
- vlaオブジェクトのカラーメソッドを設定する。
- 引数
-
- vla-object … VLAオブジェクト
- acColorMethod … acColorMethod のメソッド名。次のいずれかの定数。
- acColorMethodByACI
- acColorMethodByBlock
- acColorMethodByLayer (既定)
- acColorMethodByRGB
- acColorMethodForeground
- 戻り値
- nil
- サンプル
(defun c:layer2trucolor(/ lay tc idx)
; レイヤーのACIカラーをRGBカラーに変換
(vl-load-com)
(setq *acaddoc* (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vlax-for lay (vla-get-layers *acaddoc*)
(setq tc (vla-get-truecolor lay))
(if (= (vla-get-colormethod tc) acColorMethodByACI)
(progn
(setq idx (vla-get-colorindex tc))
(vla-put-colormethod tc acColorMethodByRGB)
(vla-put-colorindex tc idx)
(setq r (vla-get-red tc)
g (vla-get-green tc)
b (vla-get-blue tc))
(vla-setrgb tc r g b)
(vla-put-truecolor lay tc)
))))
関連事項