ColorIndex プロパティ(ActiveX) 您所在的位置:网站首页 colorindex ColorIndex プロパティ(ActiveX)

ColorIndex プロパティ(ActiveX)

#ColorIndex プロパティ(ActiveX)| 来源: 网络整理| 查看: 265

カラー インデックスを指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.ColorIndex object

タイプ: AcCmColor

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: いいえ

タイプ: acColor 列挙型

既定の色指定は acByLayer です。0 から 256 のカラー インデックス番号か、以下の定数のうちの 1 つを使ってください。

acByBlock acByLayer (Layer オブジェクトには無効) acRed acYellow acGreen acCyan acBlue acMagenta acWhite 注意

追加の注意はありません。

VBA:

Sub Example_ColorIndex() 'This example draws a circle and 'returns the closest color index. Dim cir As AcadCircle Dim pt(0 To 2) As Double Set cir = ThisDrawing.modelSpace.AddCircle(pt, 2) Dim col As AcadAcCmColor Set col = cir.TrueColor col.SetRGB 125, 175, 235 cir.TrueColor = col ZoomAll Dim retCol As AcadAcCmColor Set retCol = cir.TrueColor If col.ColorMethod = AutoCAD.acColorMethodByRGB Then MsgBox "Closest ColorIndex=" & col.ColorIndex End If End Sub

Visual LISP:

(vl-load-com) (defun c:Example_ColorIndex() ;;This example draws a circle and ;;returns the closest color index. (setq acadObj (vlax-get-acad-object) doc (vla-get-ActiveDocument acadObj)) (setq pt (vlax-3d-point 0 0 0)) (setq modelSpace (vla-get-ModelSpace doc) cir (vla-AddCircle modelSpace pt 2) col (vla-get-TrueColor cir)) (vla-SetRGB col 125 175 235) (vla-put-TrueColor cir col) (vla-ZoomAll acadObj) (setq retCol (vla-get-TrueColor cir)) (if (= (vla-get-ColorMethod col) acColorMethodByRGB) (alert (strcat "Closest ColorIndex=" (itoa (vla-get-ColorIndex col)))) ) )


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有