Results 1 to 5 of 5

Thread: EDIT THE DIMSTYLE WITHOUT IT OVERRIDING

  1. #1
    Member
    Join Date
    2014-11
    Posts
    21
    Login to Give a bone
    0

    Default EDIT THE DIMSTYLE WITHOUT IT OVERRIDING

    How do you Modify the current Dim style on autolisp without it overriding like I want to change the dimscale with either one of these it overrides it (COMMAND "DIMSCALE" 25.4) (Setvar "DIMSCALE" 25.4)

  2. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: EDIT THE DIMSTYLE WITHOUT IT OVERRIDING

    Code:
    (defun c:dimstsav ( / curdimst varname value )
      (setq curdimst (getvar 'dimstyle))
      (while
        (or
          (not (setq varname (getstring "\nSpecify variable you want to change directly to current dimstyle : ")))
          (if
            (or
              (= varname "")
              (not (wcmatch (strcase varname) "DIM*"))
            )
            t
            (not (snvalid varname))
          )
        )
        (prompt "\nVariable specified not valid...")
      )
      (setq value "")
      (while (not (snvalid value))
        (initget 1)
        (setq value (getstring t "\nSpecify value to assign to variable : "))
      )
      (cond
        ( (= (type (getvar varname)) 'str)
          (setvar varname value)
        )
        ( (= (type (getvar varname)) 'int)
          (setvar varname (atoi value))
        )
        ( (= (type (getvar varname)) 'real)
          (setvar varname (atof value))
        )
        ( (= (type (getvar varname)) 'list)
          (setvar varname (read (strcat "(" value ")")))
        )
      )
      (vl-cmdf "_.-dimstyle" "_s" curdimst)
      (while (< 0 (getvar 'cmdactive))
        (vl-cmdf "")
      )
      (princ)
    )
    HTH., M.R.
    Last edited by marko_ribar; 2019-04-13 at 06:26 AM.

  3. #3
    Member
    Join Date
    2014-11
    Posts
    21
    Login to Give a bone
    0

    Default Re: EDIT THE DIMSTYLE WITHOUT IT OVERRIDING

    That override see
    OVERRIDE.JPG

  4. #4
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: EDIT THE DIMSTYLE WITHOUT IT OVERRIDING

    Both Vanilla and Visual LISP works well on my PC :
    Visual LISP example :

    Code:
    (defun c:dimstsav ( / adoc curdimst varname value )
    
      (vl-load-com)
    
      (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
      (setq curdimst (vla-get-activedimstyle adoc))
      (while
        (or
          (not (setq varname (getstring "\nSpecify variable you want to change directly to current dimstyle : ")))
          (if
            (or
              (= varname "")
              (not (wcmatch (strcase varname) "DIM*"))
            )
            t
            (not (snvalid varname))
          )
        )
        (prompt "\nVariable specified not valid...")
      )
      (setq value "")
      (while (not (snvalid value))
        (initget 1)
        (setq value (getstring t "\nSpecify value to assign to variable : "))
      )
      (cond
        ( (= (type (getvar varname)) 'str)
          (setvar varname value)
        )
        ( (= (type (getvar varname)) 'int)
          (setvar varname (atoi value))
        )
        ( (= (type (getvar varname)) 'real)
          (setvar varname (atof value))
        )
        ( (= (type (getvar varname)) 'list)
          (setvar varname (read (strcat "(" value ")")))
        )
      )
      (vla-copyfrom curdimst adoc)
      (princ)
    )
    HTH., M.R.
    Last edited by marko_ribar; 2019-04-13 at 06:26 AM.

  5. #5
    Member
    Join Date
    2014-11
    Posts
    21
    Login to Give a bone
    0

    Default Re: EDIT THE DIMSTYLE WITHOUT IT OVERRIDING

    it started working on mine i cut it down to just this thanks
    (defun c:dimsm ( / adoc curdimst varname value )

    (vl-load-com)

    (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
    (setq curdimst (vla-get-activedimstyle adoc))
    (setq varname "dimscale")
    (setq value 24.5)
    (setvar varname value)
    (vla-copyfrom curdimst adoc)
    (princ)
    )

Similar Threads

  1. Overriding linework of elements in Design Options
    By dbaldacchino in forum Revit Architecture - General
    Replies: 3
    Last Post: 2010-04-28, 04:13 AM
  2. Replies: 0
    Last Post: 2006-07-22, 05:16 PM
  3. Display Properties "NOT" overriding
    By dinman in forum ACA General
    Replies: 5
    Last Post: 2005-10-18, 11:53 PM
  4. overriding dimensions
    By Archman in forum Revit Architecture - General
    Replies: 4
    Last Post: 2003-11-13, 09:12 PM
  5. Wall cleanups: Overriding
    By Chad Smith in forum Revit Architecture - General
    Replies: 2
    Last Post: 2003-09-23, 09:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •