See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Convert Aligned Dimensions to Rotated Dimensions

  1. #1
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Convert Aligned Dimensions to Rotated Dimensions

    Good Morning To AUGI Members:

    Is there a way to convert Aligned dimensions on a drawing to Rotated dimensions...??...

    We receive drawings from a consultant that have both Aligned and Rotated dimensions and I want to isolate the Aligned dimensions and convert them into Rotated dimensions. The reason for this replacement is to allow us to shorten or extend the dimension extension lines without disturbing the alignment (orientation) of the dimension line and text string that will occur on an Aligned dimension if you move either of the original attachment points.

    Could this be accomplished with a lisp routine...??

    If this is difficult to do can a selection set of just the Aligned dimensions be created with a lisp routine...??

    Any assistance with this matter would be appreciated.

    Regards,
    Vince

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

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Vince,

    I'll see what I can come up with this evening on changing aligned dimensions to rotated dimensions.

    For the mean time, I would suggest you look into searching the forums for "filter selection sets". This thread (Mirror a Drawing but not the xrefs. filter selection sets) will give you a start on selection set filters.
    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

  3. #3
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Here is a start.
    Code:
    (defun c:ChangeDimObject (/ Sel EntData Pt1 Pt2 Pt3)
    
    (setq Sel (entsel "\n Select dimension object: "))
    (setq EntData (entget (car Sel)))
    (setq Pt1 (cdr (assoc 13 EntData)))
    (setq Pt2 (cdr (assoc 14 EntData)))
    (setq Pt3 (cdr (assoc 11 EntData)))
    (if (< (car Pt1) (car Pt2))
     (command "_.ucs" "_3" Pt1 Pt2 (polar Pt1 (+ (DTR 90) (angle Pt1 Pt2)) 5))
     (command "_.ucs" "-3" Pt2 Pt1 (polar Pt2 (+ (DTR 90) (angle Pt2 Pt1)) 5))
    )
    (entdel (car Sel))
    (command "_.dim" "_horizontal" (trans Pt1 0 1) (trans Pt2 0 1) (trans Pt3 0 1) "" "_exit")
    (command "_.ucs" "_p")
    )
    I think it does most of what you want it to do. You can get a selection set, and cycle through the selection set with this code, and it should work.

    Tim

  4. #4
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Hello Tim:

    Thank you for your quick response.......Your example works great however, it will attempt to convert all dimension types not just Aligned dimensions. Do you know how to build a selection set for just Aligned dimensions only...??

    Any input will be appreciated.

    Regards,
    Vince

  5. #5
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    I don't think you can build a selection set for just aligned dimensions. I think you will have to build a selection set of dimensions, and then cycle through each one, test to make sure it is an aligned one, and then run the code posted.

    If you need futur help post, and I will see if I can get you something today.

    Tim

  6. #6
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    This should work. Note it will draw the new dimension on the current layer, with the current dim style.
    Code:
    (defun c:ChangeDimObject (/ ss Ent EntData Pt1 Pt2 Pt3)
    
    (setq ss (ssget '((0 . "DIMENSION"))))
    (while (setq Ent (ssname ss 0))
     (setq EntData (entget Ent))
     (if (not (member '(100 . "AcDbRotatedDimension") EntData))
      (progn
       (setq Pt1 (cdr (assoc 13 EntData)))
       (setq Pt2 (cdr (assoc 14 EntData)))
       (setq Pt3 (cdr (assoc 11 EntData)))
       (if (< (car Pt1) (car Pt2))
        (command "_.ucs" "_3" Pt1 Pt2 (polar Pt1 (+ (DTR 90) (angle Pt1 Pt2)) 5))
        (command "_.ucs" "-3" Pt2 Pt1 (polar Pt2 (+ (DTR 90) (angle Pt2 Pt1)) 5))
       )
       (entdel Ent)
       (command "_.dim" "_horizontal" (trans Pt1 0 1) (trans Pt2 0 1) (trans Pt3 0 1) "" "_exit")
       (command "_.ucs" "_p")
      )
     )
     (ssdel Ent ss)
    )
    )
    Tim

  7. #7
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Okay. Here is the final version that I am putting into my lisp routines. If there is any problem let me know.
    Code:
    (defun c:ChangeDimObject (/ ss Ent EntData Pt1 Pt2 Pt3 ocmd omode olay odim)
    ; Redraw dimension that were drawn as aligned as rotated on correct layer, and with correct dimension style.
    
    (setq ocmd (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (command "_.undo" "_end")
    (command "_.undo" "_begin")
    (setq omode (getvar "osmode"))
    (setvar "osmode" 0)
    (setq olay (getvar "clayer"))
    (setq odim (getvar "dimstyle"))
    (if (setq ss (ssget '((0 . "DIMENSION"))))
     (while (setq Ent (ssname ss 0))
      (setq EntData (entget Ent))
      (if (not (member '(100 . "AcDbRotatedDimension") EntData))
       (progn
        (setq Pt1 (cdr (assoc 13 EntData)))
        (setq Pt2 (cdr (assoc 14 EntData)))
        (setq Pt3 (cdr (assoc 11 EntData)))
        (if (< (car Pt1) (car Pt2))
         (command "_.ucs" "_3" Pt1 Pt2 (polar Pt1 (+ (DTR 90) (angle Pt1 Pt2)) 5))
         (command "_.ucs" "_3" Pt2 Pt1 (polar Pt2 (+ (DTR 90) (angle Pt2 Pt1)) 5))
        )
        (setvar "clayer" (cdr (assoc 8 EntData)))
        (command "_.dimstyle" "_r" (cdr (assoc 3 EntData)))
        (entdel Ent)
        (command "_.dim" "_horizontal" (trans Pt1 0 1) (trans Pt2 0 1) (trans Pt3 0 1) "" "_exit")
        (command "_.ucs" "_p")
       ) 
      )
      (ssdel Ent ss)
     )
    )
    (command "_.dimstyle" "_r" odim)
    (command "_.undo" "_end")
    (setvar "clayer" olay)
    (setvar "osmode" omode)
    (setvar "cmdecho" ocmd)
    (princ)
    )
    Tim

  8. #8
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Hi Tim

    Nice work

    Thank you

    f.

  9. #9
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Hello Tim:

    The code looks great but I am getting an error message "No function DTR".

    Any thoughts.....??

  10. #10
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Convert Aligned Dimensions to Rotated Dimensions

    Hi Vince

    You can change (dtr 90) on: (/ pi 2)

    f.

Page 1 of 2 12 LastLast

Similar Threads

  1. 2014: Aligned dimensions Revit LT 2014
    By terrymckdesign686250 in forum Revit - LT Support
    Replies: 0
    Last Post: 2015-01-03, 02:51 AM
  2. Aligned dimensions acting like linear dimensions (only up-down, left-right on page as viewed)
    By browns.joseph308864 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2011-12-07, 01:48 AM
  3. aligned dimensions
    By jhudtwalcker in forum Revit Architecture - General
    Replies: 2
    Last Post: 2006-08-26, 04:36 PM
  4. Aligned Dimensions
    By charliep in forum Revit Architecture - General
    Replies: 5
    Last Post: 2006-03-13, 09:14 PM
  5. Create a base point when using Aligned dimensions
    By lochoa08 in forum AutoCAD General
    Replies: 2
    Last Post: 2006-01-20, 07:51 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
  •