+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Forum Newbie LucasBrazilias's Avatar
    Computer Details
    LucasBrazilias's Computer Details
    Operating System:
    Windows 7
    Computer:
    Waiting for new beast to arrive
    Discipline
    Construction
    LucasBrazilias's Discipline Details
    Occupation
    CAD Engineer
    Discipline
    Construction
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Location
    London
    Posts
    5

    AutoCAD Can I use a script to paste objects/blocks into many drawings?

    Registered forum members do not see this ad.

    Hi

    I have a very repetative task ahead of me and I want to use a script if possible to make my day slightly more bareable.
    I need to 'paste' 8 blocks into 250+ drawings with co-ordinates 0,0,0 and I dont want to go through all the drawings individually and type: CTR, C, 0,0,0
    can anyone assist me in creating a script that will copy these 8 blocks from one drawing with a base-point of 0,0,0 and paste it to many drawings and finally qsave and close? (will be running the script using ScriptPro)

    Please help!
    Luke

  2. #2
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    2,991

    Default

    You should export those blocks from source drawing using WBLOCK command for further access - save them on disk as separate files.
    If the target drawings already exist, then create a list with their names using a BAT file and this code:
    Code:
    DIR /b *.DWG > drawings.txt
    Next step will be to create the script - I suggest you to use Excel for that. Don't forget to save it as plain text using SCR extension.
    If the paths of blocks to be inserted and/or target drawings contains spaces, should surround them by quotation marks.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  3. #3
    Forum Newbie LucasBrazilias's Avatar
    Computer Details
    LucasBrazilias's Computer Details
    Operating System:
    Windows 7
    Computer:
    Waiting for new beast to arrive
    Discipline
    Construction
    LucasBrazilias's Discipline Details
    Occupation
    CAD Engineer
    Discipline
    Construction
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Location
    London
    Posts
    5

    Default

    Thanks Mircea! you have been very helpfull I will try out this method now. Thanks!

  4. #4
    Super Member Pablo Ferral's Avatar
    Using
    Inventor 2010
    Join Date
    Feb 2005
    Location
    London
    Posts
    571

    Default

    I wrote this post on creating AutoCAD scripts for CAD-NOtes.com:
    http://cad-notes.com/2012/03/learn-h...your-plotting/

    It uses plotting as an example, but there is no reason why you could apply it to block inserts instead.

    The process is:
    -Turn off the dialogues
    -Work out how to do what you need to do using the command line only
    -Copy and paste the commands into a note pad file
    -Edit out the junk

    You could make the whole thing a step easier by putting all eight blocks inside one block and exploding it on entry.

    Don't forget to include purge and audit as part of your script!

    Paul

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

    Default

    Some more shorts cuts make your list like Msasu above but open in WORD you can create a script in a few seconds if you use "Replace"

    The ^p is the end of line so you replace ^p with "insert myblock 0,0 1 1 0 explode last close Y^p" instantly your script is half done

    Again use ^p but put a "Open" in the front of each line press enter top line, then replace ^p with ^popen once space after n

    make sure you save as a txt file with .scr
    A man who never made mistakes never made anything

  6. #6
    Forum Newbie LucasBrazilias's Avatar
    Computer Details
    LucasBrazilias's Computer Details
    Operating System:
    Windows 7
    Computer:
    Waiting for new beast to arrive
    Discipline
    Construction
    LucasBrazilias's Discipline Details
    Occupation
    CAD Engineer
    Discipline
    Construction
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Location
    London
    Posts
    5

    Default Thanks Guys!

    Registered forum members do not see this ad.

    Thats really helpful and I think I should be able to create the script from all the info you guys have given me. I will post the script on here once it's finishd incase anyone else finds it useful. Thank you very much!!!

Similar Threads

  1. Can't Copy and Paste Between Drawings
    By WireGuy1950 in forum AutoCAD Drawing Management & Output
    Replies: 10
    Last Post: 20th Sep 2012, 04:41 am
  2. Cut & Paste hangs between drawings
    By ABGroup in forum Autodesk Software General
    Replies: 17
    Last Post: 23rd May 2012, 10:45 am
  3. Copy between drawings without using Cut & Paste
    By CAD Panacea in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 7th Feb 2012, 08:00 pm
  4. Cannot copy and paste between drawings
    By KRENG in forum AutoCAD Beginners' Area
    Replies: 8
    Last Post: 16th Nov 2011, 03:07 pm
  5. Cut & Paste hangs between drawings
    By ABGroup in forum Software & Licensing
    Replies: 2
    Last Post: 9th May 2008, 11:50 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