Lisp - Altering dimension properties

Discussion in 'AutoCAD' started by lovemy65stang, Dec 18, 2006.

  1. I'm trying to write a Lisp that will change all of the dimensions
    settings in an open drawing. My company used to use arrow heads
    (Closed filled) for all their dimensions and would like to switch to
    using Architectural tick marks.
    The problem is that when we are using a drawing of something we have
    created in the past, all of the dimensions have arrows and we have to
    manually change all of the dimension's arrows, one by one, to arch
    ticks. I know there is a way to do this in Lisp, I just haven't been
    able to find it on the web. Any help would be greatly appreciated!

    Thank You,
    -Brian
    AutoCAD 2006
     
    lovemy65stang, Dec 18, 2006
    #1
  2. lovemy65stang

    Brian W. Guest

    Here is the code I have right now:
    (command "DIMBLK" "ARCHTICK" "DIMBLK1" "ARCHTICK" "DIMBLK2"
    "ARCHTICK")
    (sssetfirst nil (ssget "_X" '((0 . "DIMENSION"))))
    (command "DIM" "UPDATE" "PREV" "" "EXIT")
    This sets the dimstyle for archticks, selects all of the dimensions,
    and then updates them. The same problem still exists though, in that
    if the existing dimensions have different scales, colors, etc. they are
    all modified. I think what I really need to happen is the following
    pseudo-code:

    -Create a list of every dimension in the drawing
    -Create a list of every dimension in the drawing's dimstyle
    -Loop for each dimension
    -Set the dimstyle of the dimension to the current dimstyle
    -Set the DIMBLK, DIMBLK1, and DIMBLK2 variables to "ARCHTICK"
    -Update ONLY that one dimension
    -End Loop

    Is this even possible? Any help would be GREATLY appreciated!!!

    Thank You,
    Brian W.
     
    Brian W., Dec 20, 2006
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.