CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

Add3DPoly Method (ActiveX)

2023-1-4 13:40| 发布者: admin| 查看: 576| 评论: 0|来自: AutoCAD

摘要: 根据给定的坐标数组创建三维折线。

根据给定的坐标数组创建三维折线。

支持的平台:仅窗口

签名

工 务 局:

RetVal = object.Add3Dpoly(PointsArray)
对象

类型:模型空间,图纸空间

此方法适用的对象。

点数组

访问:仅输入

类型:变体(双打数组)

三维 WCS 坐标的数组。折线将根据数组中坐标的顺序创建。数组中的元素数必须是 3 的倍数。(三个元素定义单个坐标。

返回值(RetVal)

类型:3D奥利线

新创建的对象。3DPolyline

言论

若要闭合折线,请在对象上使用属性。Closed3DPolyline

例子

工 务 局:

Sub Example_Add3DPoly()
    
    Dim polyObj As Acad3DPolyline
    Dim points(0 To 8) As Double
    
    ' Create the array of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 10: points(4) = 10: points(5) = 10
    points(6) = 30: points(7) = 20: points(8) = 30
    
    ' Create a 3DPolyline in model space
    Set polyObj = ThisDrawing.ModelSpace.Add3DPoly(points)
    ZoomAll
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Add3DPoly()
    ;; This example creates a 3 segment 3D polyline in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Create the array of points
    (setq points (vlax-make-safearray vlax-vbDouble '(0 . 8)))
    (vlax-safearray-fill points '(0 0 0
                                  10 10 10
                                  30 20 30
                                 )
    )  
    
    ;; Create a 3D polyline in model space
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq polyObj (vla-Add3DPoly modelSpace points))
    (vla-ZoomAll acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 09:42

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部