Author Topic: Insert multiple drawings as blocks in array  (Read 4433 times)

0 Members and 1 Guest are viewing this topic.

cangelo3d

  • Guest
Insert multiple drawings as blocks in array
« on: May 01, 2012, 07:08:03 AM »
I am totally new to vba programming and unfortunately i have problem sorting out basic things.
What i want to achieve:

user sets amount of times each block is to be inserted,
user picks a point for block1,
system creates an array of one row and i numbers of columns (i=defined by the user in previous step)
user picks a point for block2,
system creates an array of one row and i numbers of columns (i=defined by the user in previous step)
and so on...

anyone has any suggestions on how to procced?
anything would be much appreciated!

(i am running vba through autocad 2012)

fixo

  • Guest
Re: Insert multiple drawings as blocks in array
« Reply #1 on: May 02, 2012, 12:10:07 AM »
See MinsertBlock method in the Help file:
Code: [Select]
Option Explicit

Public Sub TestForBlockArray()
Dim acsp As AcadBlock
Set acsp = ThisDrawing.ActiveLayout.Block
Dim pt(2) As Double
Dim blkname  As String
Dim NumRows As Long, _
NumColumns As Long, _
RowSpacing As Long, _
ColumnSpacing As Long
NumRows = 24
NumColumns = 12
RowSpacing = 700
ColumnSpacing = 350
blkname="foo"    '<-- block name
acsp.AddMInsertBlock pt, blkname, 1, 1, 1, 0, NumRows, NumColumns, RowSpacing, ColumnSpacing
End Sub

~'J'~

BlackBox

  • King Gator
  • Posts: 3770
Re: Insert multiple drawings as blocks in array
« Reply #2 on: May 02, 2012, 01:23:41 AM »
« Last Edit: May 02, 2012, 01:28:18 AM by RenderMan »
"How we think determines what we do, and what we do determines what we get."