Dimension Style

Discussion in 'AutoCAD' started by Pete Caporuscio, Sep 16, 2004.

  1. does anyone have a lsp or know of a way to set the current layer based on
    the selection of a dimstyle? the dimesion style and layer names will be
    different.
     
    Pete Caporuscio, Sep 16, 2004
    #1
  2. Pete Caporuscio

    Jeff Mishler Guest

    Something like this?
    Code:
    (defun c:dimlay (/ dlist dimstl ss lay)
    ;adjust the list to suit. The first element is a dim style,
    ; the second is the corresponding layer to use.
    (setq dlist (list '("PAPER" . "Layer1")
    '("Style2" . "Layer2")
    '("Style3" . "Layer3")
    '("Style4" . "Layer4")))
    (if (setq ss (ssget ":S" '((0 . "DIMENSION"))))
    (progn
    (setq dimstl (cdr (assoc 3 (entget (ssname ss 0)))))
    (if (and (setq lay (assoc dimstl dlist))
    (or (tblsearch "layer" (cdr lay))
    (entmake (list '(0 . "LAYER")
    '(100 . "AcDbSymbolTableRecord")
    '(100 . "AcDbLayerTableRecord")
    (cons 2 (cdr lay))
    '(70 . 0) '(62 . 7)
    '(6 . "CONTINUOUS") ))
    );or
    );and
    (setvar "clayer" (cdr lay))
    )
    )
    )
    (princ)
    )
     
    Jeff Mishler, Sep 16, 2004
    #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.