Dimstyle entmod... possible?

Discussion in 'AutoCAD' started by Douglas Barr, Aug 20, 2004.

  1. Douglas Barr

    Douglas Barr Guest

    What the heck is wrong with this????

    (defun c:dsx () ;DimStylefiX
    (setq ds (tblsearch "DIMSTYLE" "AM_ANSI"))
    (setq a42 (assoc 42 ds))
    (setq b42 (cons 42 0.005))
    (setq a176 (assoc 176 ds))
    (setq b176 (cons 176 256))
    (setq a177 (assoc 177 ds))
    (setq b177 (cons 177 256))
    (setq a178 (assoc 178 ds))
    (setq b178 (cons 178 256))
    (setq ds (subst b42 a42 ds))(entmod ds)
    (setq ds (subst b176 a176 ds))(entmod ds)
    (setq ds (subst b177 a177 ds))(entmod ds)
    (setq ds (subst b178 a178 ds))(entmod ds)
    (princ)
    )

    TIA
    -doug
     
    Douglas Barr, Aug 20, 2004
    #1
  2. Douglas Barr

    Douglas Barr Guest

    Or more simply...

    (defun c:dsx () ;DimStylefiX
    (setq ds (tblsearch "DIMSTYLE" "AM_ANSI"))
    (setq a42 (assoc 42 ds)) ; DIMEXO Extension line offset
    (setq b42 (cons 42 0.005)) ; my new setting
    (setq ds (subst b42 a42 ds))
    (entmod ds)
    (princ)
    )

    It appears to assign the new figure to assoc 42, but the setting doesn't get
    saved. Is it possible to mod a dimstyle this way? I bet I'm missing
    something simple.
    -doug
     
    Douglas Barr, Aug 20, 2004
    #2
  3. Pretty sure you need to use the tblobjname function to modify the dimstyle

    (setq ds (entget (tblobjname "DIMSTYLE" "AM_ANSI")))
     
    Allen Johnson, Aug 20, 2004
    #3
  4. Douglas Barr

    Douglas Barr Guest

    Thanks Allen, that was it.

     
    Douglas Barr, Aug 20, 2004
    #4
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.