AddSolid 方法 (ActiveX)
创建二维实体多边形。 支持的平台:仅限 Windows 签名VBA: RetVal = object.AddSolid(Point1, Point2, Point3, Point4) 言论前两点定义多边形的一条边。第三点的定义与第二点对角线相反。如果将第四个点设置为等于第三个点,则创建一个填充三角形。 仅当 AutoCAD FILLMODE 系统变量设置为“打开”时,才会填充实体。若要设置或查询系统变量,请分别使用 和 方法。SetVariableGetVariable 例子VBA: Sub Example_AddSolid() ' This example creates a solid in model space. Dim solidObj As AcadSolid Dim point1(0 To 2) As Double Dim point2(0 To 2) As Double Dim point3(0 To 2) As Double Dim point4(0 To 2) As Double ' Define the solid point1(0) = 0#: point1(1) = 1#: point1(2) = 0# point2(0) = 5#: point2(1) = 1#: point2(2) = 0# point3(0) = 4#: point3(1) = 6#: point3(2) = 0# point4(0) = 8#: point4(1) = 8#: point4(2) = 0# ' Create the solid object in model space Set solidObj = ThisDrawing.ModelSpace.AddSolid(point1, point2, point3, point4) ZoomAll End Sub 可视化 LISP: (vl-load-com) (defun c:Example_AddSolid() ;; This example creates a solid in model space. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the solid (setq point1 (vlax-3d-point 0 1 0) point2 (vlax-3d-point 5 1 0) point3 (vlax-3d-point 4 6 0) point4 (vlax-3d-point 8 8 0)) ;; Create the solid object in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq solidObj (vla-AddSolid modelSpace point1 point2 point3 point4)) (vla-ZoomAll acadObj) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-19 06:41
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.