CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2021 开发者帮助

ColumnSpacing 属性 (ActiveX)

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

ColumnSpacing 属性 (ActiveX)

指定块数组中列的间距。

支持的平台:仅限 Windows

签名

VBA:

object.ColumnSpacing
对象

类型:MInsertBlock

此属性应用于的对象。

属性值

只读:

类型:

块数组中列的间距。

言论

没有其他评论。

例子

VBA:

Sub Example_ColumnSpacing()
    ' 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

可视化 LISP:

(vl-load-com)
(defun c:Example_ColumnSpacing()
    ;; 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   苏公网安备32011402011833)

GMT+8, 2024-12-15 12:53

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部