创建二维实体多边形。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddSolid(Point1, Point2, Point3, Point4) 言论前两个点定义面的一个边。第三个点的定义与第二个点对角线相反。如果第四个点设置为等于第三个点,则创建一个填充三角形。 仅当 AutoCAD 填充模式系统变量设置为开时,才会填充实体。若要设置或查询系统变量,请分别使用 and 方法。SetVariableGetVariable 例子工 务 局: 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 Visual 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-8 19:16
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.