Jump to content

Insert multiple drawings as blocks in array


cangelo3D

Recommended Posts

I am totally new to vba programming so please help me in first baby steps

 

Steps i need to compile a code for:

 

user sets attributes used to calculate the amount of blocks to be inserted,

user picks a point to insert first block,

system creates an array of one row and i numbers of columns (i=defined by the calculation in previous step)

user picks a point to insert second block,

system creates an array of one row and i numbers of columns (i=defined by the calculation in previous step)

and so on...

 

anyone has any suggestions on how to proceed? i've only managed to do the calculations via userform so please, anything would be much appreciated!

 

(i am running vba through autocad 2012)

Link to comment
Share on other sites

With VBA future under a cloud go for VLISP pretty simple to do GETPOINT insert 1 block then either use the AARAY command or do form first principle using a double REPEAT row-column & POLAR command to work out new x value new y value.

 

(repeat row
(repeat column
(insert xy ......... 
(setq x (polar x dist 0))
.....
)
(setq y (+ y rowdist))
)

Link to comment
Share on other sites

1+ ... If you're already adept at coding VBA (ActiveX), then Visual LISP is a great way to pickup the ActiveX functionality, and learn an API that is (has been) portable for nearly all versions of AutoCAD.

 

Otherwise, the logical step would be to learn VB.NET, and ultimately C#.NET, which is where I am currently... Not that I've mastered either Visual LISP, or VB.NET, but with C#'s popularity, it just seems like a worth while step in my development (pun intended). :geek:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...