CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

Evaluate 方法 (ActiveX)

2024-5-18 19:07| 发布者: admin| 查看: 19| 评论: 0|原作者: admin|来自: AutoCAD

Evaluate 方法 (ActiveX)

评估给定的填充或引线。

支持的平台:仅限 Windows

签名

VBA:

object.Evaluate
对象

类型:舱口领导者

此方法应用到的对象。

返回值 (RetVal)

无返回值。

言论

引线:评估引线与其关联注释的关系,并在必要时更新引线几何。

剖面线:使用指定的剖面图案评估对象的剖面线或实体填充。对于常规填充图案,此方法在图案定义线和填充边界曲线之间执行交点计算以形成填充线。对于实体填充填充图案,此方法对填充区域进行三角测量,并用给定颜色填充三角形网格。Hatch

例子

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

可视化 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)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-6-27 16:14

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部