+ Reply to Thread
Results 1 to 7 of 7

Thread: X-Y Dimensions

  1. #1
    Full Member
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Sep 2017
    Posts
    35

    Default X-Y Dimensions

    Registered forum members do not see this ad.

    Is there a way to dimension the x-y lengths between two points at the same time without have to do a linear dimension each time?

    I don't wan't coordinates. I am looking for lengths.

    Maybe a lisp or a macro?

    Thanks

  2. #2
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,175

    Default

    Simplest way is a dimension style you can turn off lots of stuff so could just have a style which is the arrows but it would use the dim align command but a little lisp would fix that.

    Good one to have a go at yourself. In words pick pt1, pick pt2, command dim align pt1 pt2 all done
    A man who never made mistakes never made anything

  3. #3
    Full Member
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Sep 2017
    Posts
    35

    Default

    If only I knew how to write lisp codes.

  4. #4
    Full Member
    Computer Details
    Dahzee's Computer Details
    Operating System:
    64bit Windows 7 pro
    Monitor:
    24" x 2
    Discipline
    See details...
    Dahzee's Discipline Details
    Occupation
    Cardboard Engineer
    Discipline
    See details below.
    Details
    Design & Prototyping of Cardboard Packaging and Point of Sale.
    Using
    not applicable
    Join Date
    Sep 2010
    Location
    Hampshire (England)
    Posts
    30

    Default

    Robwell,

    This will dimension x and y of a selection, not sure if it is what you need.

    Tharwat kindly wrote this so make sure you don't remove his name.

    Code:
    (defun c:kk (/ s i l r l1 r1 lx ly rx ry a b c d p1 p2 p3)
      ;;    Tharwat 28. Nov. 2013         ;;
      (if (setq s (ssget '((-4 . "<NOT")
                           (-4 . "<OR")
                           (0 . "XLINE")
                           (0 . "RAY")
                           (0 . "*DIMENSION")
                           (-4 . "OR>")
                           (-4 . "NOT>")
                          )
                  )
          )
        (progn
          (repeat (setq i (sslength s))
            (vla-GetBoundingBox
              (vlax-ename->vla-object (ssname s (setq i (1- i))))
              'l
              'r
            )
            (setq l1 (vlax-safearray->list l)
                  r1 (vlax-safearray->list r)
                  lx (cons (car l1) lx)
                  ly (cons (cadr l1) ly)
                  rx (cons (car r1) rx)
                  ry (cons (cadr r1) ry)
            )
          )
          (setq a  (apply 'min lx)
                b  (apply 'min ly)
                c  (apply 'max rx)
                d  (apply 'max ry)
                p1 (list c d)
                p2 (list a d)
                p3 (list c b)
          )
          (command "._dimlinear"
                   "_none"
                   p1
                   "_none"
                   p2
                   "_none"
                   (polar p1 (* pi 0.5) (/ (distance p1 p2) 10.))
          )
          (command "._dimlinear"
                   "_none"
                   p1
                   "_none"
                   p3
                   "_none"
                   (polar p1 0. (/ (distance p1 p3) 10.))
          )
        )
      )
      (princ)
    )
    (vl-load-com)

  5. #5
    Full Member
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Sep 2017
    Posts
    35

    Default

    This works perfectly. I was able to manipulate a couple numbers to make the offset a little further out. The only thing I wish I knew how to do would be to put the dims on the opposite sides in which they are placed with this lisp. I can still definitely use it though. Thank you.

    If anyone knows how to manipulate the location placement of the dims, that would be awesome.

    Thanks again, Dahzee.

  6. #6
    Super Member CyberAngel's Avatar
    Computer Details
    CyberAngel's Computer Details
    Operating System:
    Windows 10
    Discipline
    Architectural
    CyberAngel's Discipline Details
    Occupation
    Civil Drafter
    Discipline
    Architectural
    Details
    Roofing and Waterproofing
    Using
    AutoCAD 2014
    Join Date
    Jul 2006
    Location
    Anywhere Else
    Posts
    1,179

    Default

    Quote Originally Posted by robwell View Post
    If anyone knows how to manipulate the location placement of the dims, that would be awesome.
    If I understand what you want and what the code says, you can move the origin to the other side of the selection box. In other words, the line

    p1 (list c d)

    becomes

    p1 (list a b)
    breaking AutoCAD on a regular basis since 1991

  7. #7
    Full Member
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Sep 2017
    Posts
    35

    Default

    Registered forum members do not see this ad.

    That's the right direction CyberAngel, thanks. It doesn't place them exactly as I like, so I will work with that to find the right placement.

Similar Threads

  1. Aligned Dimensions vs Rotated Dimensions
    By Tyke in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 17
    Last Post: 10th Oct 2013, 01:51 pm
  2. Dimensions with arc?
    By tennis4you in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 8
    Last Post: 2nd Jun 2011, 06:29 pm
  3. Drive feature dimensions with sketch dimensions?
    By Hickoz_bro in forum SolidWorks
    Replies: 4
    Last Post: 15th May 2011, 01:41 am
  4. Dimensions
    By donbosco in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 22nd Oct 2010, 08:11 pm
  5. dimensions fly away
    By the ber in forum AutoCAD Beginners' Area
    Replies: 8
    Last Post: 23rd Mar 2008, 09:47 am

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