Dimstyle and VLisp

Discussion in 'AutoCAD' started by Marcel Goulet, Nov 10, 2004.

  1. Hi,

    If I have two dimstyles named A and B and A is the current dimstyle.

    If I want for example to change the DIMLFAC variable for the dimstyle A, can I do it with out make it current ?

    If yes, how ??

    Thanks.
     
    Marcel Goulet, Nov 10, 2004
    #1
  2. Don't think you can do it without (at least
    temporarily) setting it current.

    --
    Autodesk Discussion Group Facilitator



    can I do it with out make it current ?
     
    Jason Piercey, Nov 10, 2004
    #2
  3. Marcel Goulet

    Jürg Menzi Guest

    Salü Marcel

    Try this one:
    Code:
    (defun C:Test ( / TblEnt TblLst TblEnt)
    (setq TblEnt (tblobjname "DIMSTYLE" "ISO-25")
    TblLst (entget TblEnt)
    TblLst (if (assoc 144 TblLst)
    (subst (cons 144 50.0) (assoc 144 TblLst) TblLst)
    (append TblLst (list (cons 144 50.0)))
    )
    TblLst (entmod TblLst)
    )
    (entupd TblEnt)
    (princ)
    )
    
    Sets DIMLFAC to 50.0. For other DXF codes see: Help -> DXF-Referece DIMSTYLE

    Cheers
     
    Jürg Menzi, Nov 10, 2004
    #3
  4. Marcel Goulet

    Tom Smith Guest

    Jürg, I believe that will crash if the ISO-25 dimstyle doesn't exist. How
    about:

    (defun C:Test ( / TblEnt TblLst TblEnt)
    (if (setq TblEnt (tblobjname "DIMSTYLE" "ISO-25"))
    (setq
    TblLst (entget TblEnt)
    TblLst (if (assoc 144 TblLst)
    (subst (cons 144 50.0) (assoc 144 TblLst) TblLst)
    (append TblLst (list (cons 144 50.0))))
    TblLst (entupd (entmod TblLst))))
    (princ))
     
    Tom Smith, Nov 11, 2004
    #4
  5. Marcel also asked for vlisp..... which I don't
    think you can do without setting the style current.
     
    Jason Piercey, Nov 11, 2004
    #5
  6. Marcel Goulet

    Jürg Menzi Guest

    Tom
    You're right of course...

    Jason
    Correct, thats why I've used vanilla...

    Cheers
     
    Jürg Menzi, Nov 11, 2004
    #6
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.