CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

列属性 (ActiveX)

2023-1-3 20:23| 发布者: admin| 查看: 246| 评论: 0|来自: AutoCAD

摘要: 指定块数组或表中的列数。

指定块数组或表中的列数。

支持的平台:仅窗口

签名

工 务 局:

object.Columns
对象

类型:最小块

此属性适用的对象。

属性值

只读:

类型:

块数组或表中的列数。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_Columns()
    ' This example creates a new MInsertBlock in the current drawing and
    ' displays the column and row information for the new MInsertBlock
    
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newMBlock As AcadMInsertBlock
    Dim newBlock As AcadBlock
        
    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5
    
    ' Create a new block to hold the Circle
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")
    
    ' Add the Circle object to the new block
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)
    
    ' Create a rectangular array of Circles using the new block containing the Circle
    ' and the AddMInsertBlock method
    Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)
        
    ThisDrawing.Application.ZoomAll
    
    ' Display information about the Columns and Rows defined by the MInsertBlock
    MsgBox "The new rectangular array comprises: " & vbCrLf & _
            newMBlock.Columns & " columns with a spacing of " & newMBlock.ColumnSpacing & " and" & vbCrLf & _
            newMBlock.Rows & " rows with a spacing of " & newMBlock.RowSpacing

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Columns()
    ;; This example creates a new MInsertBlock in the current drawing and
    ;; displays the column and row information for the new MInsertBlock
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
        
    ;; Define the Circle object
    (setq centerPoint (vlax-3d-point 0 0 0)
          InsertPoint (vlax-3d-point 1 1 0)
          radius 0.5)
    
    ;; Create a new block to hold the Circle
    (setq newBlock (vla-Add (vla-get-Blocks doc) centerPoint "CBlock"))
    
    ;; Add the Circle object to the new block
    (setq circleObj (vla-AddCircle newBlock centerPoint radius))
    
    ;; Create a rectangular array of Circles using the new block containing the Circle
    ;; and the AddMInsertBlock method
    (setq modelSpace (vla-get-ModelSpace doc))   
    (setq newMBlock (vla-AddMInsertBlock modelSpace InsertPoint "CBlock" 1 1 1 1 2 2 1 1))
        
    (vla-ZoomAll acadObj)
    
    ;; Display information about the Columns and Rows defined by the MInsertBlock
    (alert (strcat "The new rectangular array comprises: \n"
                   (itoa (vla-get-Columns newMBlock)) " columns with a spacing of " (rtos (vla-get-ColumnSpacing newMBlock) 2) " and\n"
                   (itoa (vla-get-Rows newMBlock)) " rows with a spacing of " (rtos (vla-get-RowSpacing newMBlock) 2) "."))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 15:17

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部