GenerateUsageData Method (ActiveX)

Generates data specifying whether a layer is in use.

Supported platforms: Windows only

Signature

VBA:

object.GenerateUsageData
object

Type: Layers

The object this method applies to.

Return Value (RetVal)

No return value.

Remarks

No additional remarks.

Examples

VBA:

Sub Example_GenerateUsageData()
    ' This example provides usage information for the layers
    ' in a drawing
    Dim MyLayers As AcadLayers
    Set MyLayers = ThisDrawing.Layers
    
    MyLayers.GenerateUsageData
    
    Dim MyLayerObj As AcadLayer
    For Each MyLayerObj In ThisDrawing.Layers
        MyLayerObj.Description = "Test"
        MsgBox (MyLayerObj.Used)
    Next MyLayerObj
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_GenerateUsageData()
    ;; This example provides usage information for the layers
    ;; in a drawing
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq MyLayers (vla-get-Layers doc))
    (vla-GenerateUsageData MyLayers)
  
    (vlax-for MyLayerObj MyLayers
        (vla-put-Description MyLayerObj "Test")
        (alert (strcat "Layer " (vla-get-Name MyLayerObj) (if (= (vla-get-Used MyLayerObj) :vlax-true) " is used." " is not used.")))
    )
)