See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Add or subtract a number from a dimension

  1. #11
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    Quote Originally Posted by remi678731 View Post
    This whole post has really gotten out of hand although I find it really amusing. 1st of all not all projects are cookie cutter perfect nor does everyone have the same work flow. Most places have reasons for what they do, and if not they are on really thin ice. 2nd when you start using always and never the one thing you can be sure of sooner or later you will be wrong. I have used offset linework for clarity which was identified as such and clearly stated. 3rd dims are just text at the basic level so if you are confident enough to be able to edit a dimension I'm not sure I want the liability of telling you how to do it. This really basic stuff.
    I wouldn't say this has gotten "out of hand" I don't know why you would say that, most of us really want to know the specifics and why you would want to/have to do this.
    There's a reason AutoCAD (and CAD programs) is designed to be accurate, in most cases, it's best-practice to use it that way to avoid issues, not to mention it's actually more work to do it inaccurate.

    At least in MY case, wanting to know the process to maybe help in a more refined way other than overriding dimensions, but it seems that's what the OP needs to do.
    I wouldn't call this "basic stuff", it's a trick for that particular shop they need to do, but not any procedure I've seen/used in over 25 years in the business, but I do Arch and Struct, this is a Civil 3D thread so I wouldn't know if that is done a lot.

    I think Tom's reply is the best method if it works (which it looks like it would)

  2. #12
    Certified AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    5,069
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    yeah, the PM asking that is opening up a massive liability hole for the company. I can pretty much guarantee that mixing accurate representation with deliberately in-accurate representations is going to put him on the losing side of a lawsuit. One that may well end up costing them their license.

  3. #13
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    Here's a quick modification to the linked code from Tom's apt post:

    Code:
    (defun c:-D (/ ) (_AddSubtractDim -1.5))
    (defun c:+D (/ ) (_AddSubtractDim 1.5))
    ;;;--------------------------------------------------------------------;
    (defun _AddSubtractDim (addon / dimss c ddata); = Dimension Text: Add Constant value
      (setq
    ;;;    addon (getreal "\nConstant value to add to text of selected Dimension(s): ")
        dimss (ssget ":L" '((0 . "DIMENSION")))
        c -1
      )
      (repeat (sslength dimss)
        (setq
          ddata (entget (ssname dimss (setq c (1+ c))))
          ddata
            (subst
              (cons 1 (rtos (+ (cdr (assoc 42 ddata)) addon) 2 2)); <-- adjust mode/precision as desired
              (assoc 1 ddata)
              ddata
            )
        )
        (entmod ddata)
      )
      (princ)
    )
    If not already done so, it might make sense to have disparate layers for those you're reducing vs those you're increasing. Just to make it easier to select similar & invoke -D or +D, etc.

    Cheers
    Last edited by BlackBox; 2022-01-11 at 12:47 PM. Reason: c was not localized variable in source code (and should have been).
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  4. #14
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    972
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    how do you invoke this? I copied the code and loaded it, but I can't seem to get it to work.
    gives me "unknown command".

  5. #15
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,103
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    What command did you type after loading it?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #16
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    972
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    _AddSubtractDim

  7. #17
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,103
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    That is not a command line routine as defined in the code provided by BlackBox. To determine command line routine names, look at routines that are defined using the (defun c: prefix. The string following the colon ":" is the name of the command.

    For the code posted by BlackBox, the two command line routines are "-D" and "+D". These two commands will subtract or add 1.5 to the overall value of the selected dimensions, respectively.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  8. #18
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    972
    Login to Give a bone
    0

    Default Re: Add or subtract a number from a dimension

    Thanks Opie.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. SUBTRACT Command Not working
    By dvilla2 in forum AutoCAD 3D (2006 or below)
    Replies: 22
    Last Post: 2016-01-23, 07:55 AM
  2. Booleen Model Add Subtract Modifiers (Autocad MEP 2011)
    By saidriad71 in forum Parts Builder
    Replies: 1
    Last Post: 2011-09-21, 08:02 AM
  3. Subtract column from wall
    By E-Key in forum Revit Architecture - General
    Replies: 3
    Last Post: 2005-05-03, 09:48 PM
  4. Subtract values
    By windowsxp5 in forum AutoLISP
    Replies: 6
    Last Post: 2004-10-12, 12:47 PM
  5. Add/subtract from the selection set in 6.0
    By Dean Camlin in forum Revit Architecture - General
    Replies: 6
    Last Post: 2003-12-30, 02:32 AM

Posting Permissions

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