Evaluate Method (ActiveX)

Evaluates the given hatch or leader.

Supported platforms: Windows only

Signature

VBA:

object.Evaluate
object

Type: Hatch, Leader

The objects this method applies to.

Return Value (RetVal)

No return value.

Remarks

Leader: Evaluates the relation of the leader to its associated annotation, and updates the leader geometry if necessary.

Hatch: Evaluates the hatch lines or solid fill for the Hatch object using the specified hatch pattern. For regular hatch patterns, this method performs intersection calculations between pattern definition lines and hatch boundary curves to form hatch lines. For solid fill hatch patterns, this method performs triangulation of the hatch area and fills in the triangular meshes with the given color.

Examples

VBA:

Sub Example_Evaluate()
    ' This example creates an associative hatch in model space.
    ' It uses the Evaluate method to calculate the hatch
    ' lines for the given boundary.
    
    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean
    
    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True
    
    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)
    
    ' Create the outer boundary for the hatch. (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    
    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Evaluate()
    ;; This example creates an associative hatch in model space.
    ;; It uses the Evaluate method to calculate the hatch
    ;; lines for the given boundary.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the hatch
    (setq patternName "ANSI31"
          patternType acHatchPatternTypePreDefined
          bAssociativity :vlax-true)
    
    ;; Create the associative Hatch object in model space
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq hatchObj (vla-AddHatch modelSpace patternType patternName bAssociativity acHatchObject))
    
    ;; Create the outer boundary for the hatch. (a circle)
    (setq center (vlax-3d-point 3 3 0)  
          radius 1)

    (setq outerLoop (vlax-make-safearray vlax-vbObject '(0 . 0)))
    (vlax-safearray-put-element outerLoop 0 (vla-AddCircle modelSpace center radius))
    
    ;; Append the outerboundary to the hatch object, and display the hatch
    (vla-AppendOuterLoop hatchObj outerLoop)
    (vla-Evaluate hatchObj)
    (vla-Regen doc :vlax-true)
)