BookName プロパティ(ActiveX)

色のブック名(存在する場合)を指定します。

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

構文と要素

VBA:

object.BookName
object

タイプ: AcCmColor

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

プロパティの値

読み込み専用: はい

タイプ: 文字列

色が属するカラー ブックの名前。

注意

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

VBA:

Sub Example_BookName()
    'This example draws a circle and
    'returns the color name and color book name of the color.

    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
    col.SetNames "MyColor", "MyColorBook"
    cir.TrueColor = col

    ZoomAll
    
    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor
    MsgBox "BookName=" & col.BookName & vbLf & _
           "ColorName=" & col.ColorName
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_BookName()
    ;; This example draws a circle and
    ;; returns the color name and color book name of the color.
    (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))

    (setq col (vla-get-TrueColor cir))
    (vla-SetRGB col 125 175 235)
    (vla-SetNames col "MyColor" "MyColorBook")
    (vla-put-TrueColor cir col)

    (vla-ZoomAll acadObj)
    
    (setq retCol (vla-get-TrueColor cir))
    (alert (strcat "BookName=" (vla-get-BookName col)
                   "\nColorName=" (vla-get-ColorName col)
           )
    )
)