+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    dtessier
    Guest

    Default Creating Macros??

    Registered forum members do not see this ad.

    I am relatively new in writing macros in AutoCAD, but do have experience with VBA in Excel. I am needing to alter a large number of drawings in the following way:

    1) Change all font in the drawing to a different font style
    ie. Before: test, After: test

    2) All font that is aligned vertically to be aligned horizontally
    ie. Before: t After: test
    e
    s
    t

    3)Delete all blocks in the drawing, and also in the block library.

    4)Delete drawing borders.

    Would anyone know of any macros that might do this or something similiar to this, that I might be able to alter. I would normally do this by hand, but since there are a large number of drawings that I must do this for, I would prefer to do it with a macro. Thank you in advance for your time and consideration.

    Dustin[/b]

  2. #2
    Forum Deity
    Using
    not specified
    Join Date
    Jul 2004
    Location
    Anchorage, Alaska
    Posts
    2,074

    Default

    I can suggest a few lisp statements for some of the tasks. Once you complete the routine, run it in a batch process to operate on multiple drawings. Or, modify your acad.lsp to start the routine on starting drawing. The last lines in the routine could be to save and close the drawing. Then open multiple drawings at one time.

    1. lisp to select all text and mtext

    (setq alltext (ssget "x" '((0 . *text))))
    (setq ecount 0)
    (repeat (sslength alltext)
    (setq ename (ssname ecount alltext))
    (etc...stuff to substitute one font for another)
    )

    2. same as 1, check alignment codes, if vertical change to horiz, left justified.

    3.
    (setq allblocks (ssget "x" (0 . "insert")))
    (command "erase" allblocks "")
    (command "purge" "block" etc.....)


    4. dunno...what type of object is the border?

  3. #3
    dtessier
    Guest

    Default

    Registered forum members do not see this ad.

    I will leave the batching process for now, as I would like to get it to run correctly on one drawing to start....


    As I had mentioned, I am not familiar with lisp statements. Do you place the code in the same place as you would with macros??? I'm just not sure how to test the code that you had offered? I hope this makes sense, and thank you for taking the time to reply...
    Dustin

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