+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Junior Member
    Using
    AutoCAD 2009
    Join Date
    Sep 2009
    Location
    Athens, Greece
    Posts
    20

    Default Insert multiple drawings as blocks in array

    Registered forum members do not see this ad.

    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)

  2. #2
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,780

    Default

    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.

    Code:
    (repeat row
    (repeat column
    (insert xy ......... 
    (setq x (polar x dist 0))
    .....
    )
    (setq y (+ y rowdist))
    )
    A man who never made mistakes never made anything

  3. #3
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,932

    Default

    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).
    "Potential has a shelf life." - Margaret Atwood

  4. #4
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,586

    Default

    Registered forum members do not see this ad.

    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

Similar Threads

  1. Insert Multiple blocks into drawing?
    By skipsophrenic in forum AutoLISP, Visual LISP & DCL
    Replies: 46
    Last Post: 10th Jan 2013, 11:02 am
  2. Insert block for multiple drawings using lisp on a specified Co-ordinates
    By Baluontheline_001 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 29th Feb 2012, 07:17 am
  3. Insert a block in multiple drawings using script
    By Arek80 in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 8
    Last Post: 14th Dec 2011, 03:02 am
  4. Use Lisp to search & insert multiple drawings as blocks.
    By rob150588 in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 22nd Feb 2011, 12:28 pm
  5. insert blocks from a drawing containing multiple blocks
    By comcu in forum AutoCAD Drawing Management & Output
    Replies: 12
    Last Post: 16th Feb 2009, 02:35 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts