ColumnSpacing 属性 (ActiveX)
指定块数组中列的间距。 支持的平台:仅限 Windows 属性值只读:不 类型:双 块数组中列的间距。 言论没有其他评论。 例子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) ".")) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 12:53
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.