ColumnSpacing プロパティ(ActiveX)

ブロック配列の列の間隔を指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.ColumnSpacing
object

タイプ: 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

Visual 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) "."))
)