+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 26
  1. #11
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    Registered forum members do not see this ad.

    Not a problem

    Code:
    (defun c:MacDim (/ ss num)
      (vl-load-com)
      (if (and (setq ss (ssget '((0 . "DIMENSION"))))
               (setq num (getreal "\nSpecify Alteration: ")))
        (mapcar
          (function
            (lambda (x)
              (vla-put-ExtensionLineColor x 1) ;; <<-- 1 = Red
                (vla-put-DimensionLineColor x 1)
              (vla-put-TextOverride x
                (strcat
                  (vla-get-TextPrefix x)
                    (rtos (+ (vla-get-Measurement x) num)
                       (vla-get-UnitsFormat x)
                          (vla-get-PrimaryUnitsPrecision x))
                      (vla-get-TextSuffix x)))))
          (mapcar 'vlax-ename->vla-object
            (vl-remove-if 'listp
              (mapcar 'cadr (ssnamex ss))))))
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  2. #12
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Jun 2009
    Posts
    8

    Default

    Thanks Lee,
    What I'm looking for is to change the dim text colour not the extension lines as I have set the dim style up to turn off all extension lines, leaders and arrow heads so all you see is this "25x3000" which is what I want changed.

    Many Thank

    silverfish

  3. #13
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    Quote Originally Posted by silverfish View Post
    Thanks Lee,
    What I'm looking for is to change the dim text colour not the extension lines as I have set the dim style up to turn off all extension lines, leaders and arrow heads so all you see is this "25x3000" which is what I want changed.

    Many Thank

    silverfish
    Sorry, I wasn't exactly sure what you wanted. - Its not hard to change it, no worries
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  4. #14
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    Here ya go:

    Code:
    (defun c:MacDim (/ ss num)
      (vl-load-com)
      (if (and (setq ss (ssget '((0 . "DIMENSION"))))
               (setq num (getreal "\nSpecify Alteration: ")))
        (mapcar
          (function
            (lambda (x)
              (vla-put-TextColor x 1) ; <<-- 1 = Red
                (vla-put-TextOverride x
                  (strcat
                    (vla-get-TextPrefix x)
                      (rtos (+ (vla-get-Measurement x) num)
                        (vla-get-UnitsFormat x)
                          (vla-get-PrimaryUnitsPrecision x))
                        (vla-get-TextSuffix x)))))
          (mapcar 'vlax-ename->vla-object
            (vl-remove-if 'listp
              (mapcar 'cadr (ssnamex ss))))))
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  5. #15
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Jun 2009
    Posts
    8

    Default

    Thanks again Lee, works perfectly!
    Perhaps you can answer this question I have.
    When doing the dimension is it possible to have the prefix above the line and the dimension value below the line.

    many thanks

  6. #16
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    Use: "\X" like this:

    Code:
    (defun c:MacDim (/ ss num)
      (vl-load-com)
      (if (and (setq ss (ssget '((0 . "DIMENSION"))))
               (setq num (getreal "\nSpecify Alteration: ")))
        (mapcar
          (function
            (lambda (x)
              (vla-put-TextColor x 1) ; <<-- 1 = Red
                (vla-put-TextOverride x
                  (strcat
                    (vla-get-TextPrefix x) "\\X"
                      (rtos (+ (vla-get-Measurement x) num)
                        (vla-get-UnitsFormat x)
                          (vla-get-PrimaryUnitsPrecision x))
                        (vla-get-TextSuffix x)))))
          (mapcar 'vlax-ename->vla-object
            (vl-remove-if 'listp
              (mapcar 'cadr (ssnamex ss))))))
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  7. #17
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Jun 2009
    Posts
    8

    Default

    You are truly a wizzard at this Lee! CHEERS

    Every time you help me on this I find I have another request......;-)
    Is it possible to move the prefix to a layer named "FPS SPRINKLER DIA" and the dimension value to a layer named "FPS SPRINKLER LIST"

    Many thanks
    Bruce

  8. #18
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    Quote Originally Posted by silverfish View Post
    You are truly a wizzard at this Lee! CHEERS

    Every time you help me on this I find I have another request......;-)
    Is it possible to move the prefix to a layer named "FPS SPRINKLER DIA" and the dimension value to a layer named "FPS SPRINKLER LIST"

    Many thanks
    Bruce
    The dimension is a single entity, and on its own layer, so without making the prefix and dimension strings out of separate entities, I don't think this is possible.
    Last edited by Lee Mac; 1st Jul 2009 at 05:14 pm.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  9. #19
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Jun 2009
    Posts
    8

    Default

    Thanks Lee. Much appreciated.

    bruce

  10. #20
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Aug 2012
    Posts
    4

    Default

    Registered forum members do not see this ad.

    Hi Guys

    I am too in the fire protection industry and have the same query as Bruce.
    I am well trained in Autocad but unfortunately my knowledge with regards to programming is very limited. Could you perhaps walk me through loading a LISP?

    Lee im on your website amd i am attempting to do it.

    Thanks In advance

Similar Threads

  1. Manipulating JPEGs in Autocad
    By Jovial in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 9th Mar 2009, 03:50 pm
  2. Changing values in Linear Dimension
    By Evil_eyes in forum AutoCAD Beginners' Area
    Replies: 30
    Last Post: 9th Feb 2009, 11:43 pm
  3. How to convert Latitude / Longitude values in to Northing / Easting values in meters
    By Chenna Siva Koteswara rao in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 28th Dec 2008, 11:09 pm
  4. Manipulating Autocad from Excel
    By Joro-- in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 17th Nov 2005, 11:01 pm
  5. Manipulating my background
    By hyposmurf in forum AutoCAD 3D Modelling & Rendering
    Replies: 14
    Last Post: 11th Jun 2004, 07:21 pm

Bookmarks

Posting Permissions

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