<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dimension Entity Data in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7960141#M105756</link>
    <description>&lt;P&gt;Hmmm.&amp;nbsp; The treatment of aligned dimensions is a little challenging because you had better not trim or extend the extension lines by differing distances.&amp;nbsp; I guess the solution is to trim or extend both by the shorter of the two distances (if not the same).&amp;nbsp; The first thing I will have to do is figure out how to recognize the difference between an aligned dimension and an orthogonal dimension, and whatever the others are.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 21:53:08 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2018-04-25T21:53:08Z</dc:date>
    <item>
      <title>Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7949859#M105751</link>
      <description>&lt;P&gt;I have been inspecting the contents of dimension entity data towards making a TrimDim command.&amp;nbsp; At the pool liner manufacturing place I am working, their standard is to back the extension lines away from the pool plan view so as not to clutter the print out.&amp;nbsp; It's annoying to see all the gripping and stretching, so I intend to give them a more powerful tool that will save time.&amp;nbsp; No, I am not worried about losing associativity.&amp;nbsp; They thoroughly check all the dimensions before labeling.&amp;nbsp; The labels are for the record and QC inspection with a plan view being returned to the customer.&lt;/P&gt;&lt;P&gt;It appears that the 13 and 14 codes represent the endpoints of the extension lines, but not the nearby dimension points.&amp;nbsp; I would really like to get the points, if possible.&amp;nbsp; Then there is a 10 code for the right end of the dimension (arrowhead) but none for the left end.&lt;/P&gt;&lt;P&gt;My tough right now is to find the points of intersection of the extension lines with a line to be selected as the trim boundary, and then modify the 13 and 14 data accordingly.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 14:21:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7949859#M105751</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-21T14:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7951157#M105752</link>
      <description>&lt;P&gt;Plus, the only point data in its vla-object properties is TextPosition.&lt;/P&gt;&lt;P&gt;My mistake... upon closer inspection, the 13 and 14 codes ARE the dimension points, and they can be entmoded.&lt;/P&gt;&lt;P&gt;I will solve this myself.&lt;/P&gt;&lt;P&gt;Anyone want to try it when it's done?&lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 23:52:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7951157#M105752</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-22T23:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7953660#M105753</link>
      <description>&lt;PRE&gt;(defun c:TrimDim ( / *error* vars vals ss i e1 e2 obj1 obj2 ints ent p10 p13 p14 p13x p14x)&lt;BR /&gt;  ;; (c) 2018, John F. Uhden&lt;BR /&gt;  ;; Program trims selected dimensions (extension lines) to a line or polyline.
  (defun *error* (error)
    (mapcar 'setvar vars vals)
    (vla-endundomark *doc*)
    (cond
      ((not error))
      ((wcmatch (strcase error) "*QUIT*,*CANCEL*"))
      (1 (princ (strcat "\nERROR: " error)))
    )
    (princ)
  )
  ;; Function to group a list of items into a list of
  ;; multiple lists, each of length N, e.g.
  ;; '(A B C D E F G H I) -&amp;gt; '((A B C)(D E F)(G H I))
  (defun @group (lst n / item new)
    (foreach element (reverse lst)
      (setq item (cons element item))
      (if (= (length item) n)
        (setq new (cons item new) item nil)
      )
    )
    new
  )
  (setq vars '(cmdecho))
  (setq vals (mapcar 'getvar vars))
  (or *acad* (setq *acad* (vlax-get-acad-object)))
  (or *doc* (setq *doc* (vla-get-ActiveDocument *acad*)))
  (vla-endundomark *doc*)
  (vla-startundomark *doc*)
  (mapcar 'setvar vars '(0))
  (command "_.expert" (getvar "expert")) ;; dummy command
  (and
    (princ "\nSelect dimensions to trim: ")
    (setq ss (ssget '((0 . "DIMENSION"))))
    (setq e2 (car (entsel "\nSelect trim line/polyline: ")))
    (repeat (setq i (sslength ss))
      (setq e1 (ssname ss (setq i (1- i))))
      (setq ent (entget e1))
      (setq obj1 (vlax-ename-&amp;gt;vla-object e1)
            obj2 (vlax-ename-&amp;gt;vla-object e2)
            ints (@group (vlax-invoke obj1 'intersectwith obj2 0) 3)
      )
      (setq p10 (cdr (assoc 10 ent)))
      (setq p13 (cdr (assoc 13 ent)))
      (setq p14 (cdr (assoc 14 ent)))
      (setq ang (angle p14 p10))
      (not (setq p13x nil p14x nil))
      (foreach p ints
        (if (equal (angle p13 p) ang 1e-3)
          (if (or (not p13x)(&amp;lt; (distance p13 p)(distance p13 p13x)))
            (setq p13x p)
          )
        )
        (if (equal (angle p14 p) ang 1e-3)
          (if (or (not p14x)(&amp;lt; (distance p14 p)(distance p14 p14x)))
            (setq p14x p)
          )
        )
        1
      )
      (if p13x (setq ent (subst (cons 13 p13x)(assoc 13 ent) ent)) 1)
      (if p14x (setq ent (subst (cons 14 p14x)(assoc 14 ent) ent)) 1)
      (entmod ent)
      (entupd e1)
    )
  )
  (*error* nil)
)
(defun c:TD ()(c:TrimDim))&lt;/PRE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote:&lt;BR /&gt;&lt;P&gt;Plus, the only point data in its vla-object properties is TextPosition.&lt;/P&gt;&lt;P&gt;My mistake... upon closer inspection, the 13 and 14 codes ARE the dimension points, and they can be entmoded.&lt;/P&gt;&lt;P&gt;I will solve this myself.&lt;/P&gt;&lt;P&gt;Anyone want to try it when it's done?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:24:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7953660#M105753</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-23T19:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7957678#M105754</link>
      <description>&lt;P&gt;Hi John,&amp;nbsp;I like the idea... looks like the routine may be useful to me as well &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I guess you had fun to explore the things around and hope that this is just the first release... because the functioning is still very limited - eg. for an orthogonal dims only?! BTW Why the trim only? It should do trim/extend all together if needed....&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 07:54:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7957678#M105754</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-04-25T07:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7959311#M105755</link>
      <description>I'll work on it *(after I build a trestle table to relocate my laptop to my&lt;BR /&gt;bedroom so that I can be exiled from the fun room).*</description>
      <pubDate>Wed, 25 Apr 2018 17:17:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7959311#M105755</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-25T17:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7960141#M105756</link>
      <description>&lt;P&gt;Hmmm.&amp;nbsp; The treatment of aligned dimensions is a little challenging because you had better not trim or extend the extension lines by differing distances.&amp;nbsp; I guess the solution is to trim or extend both by the shorter of the two distances (if not the same).&amp;nbsp; The first thing I will have to do is figure out how to recognize the difference between an aligned dimension and an orthogonal dimension, and whatever the others are.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 21:53:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7960141#M105756</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-25T21:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7960966#M105757</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote:&lt;BR /&gt;&lt;P&gt;Hmmm.&amp;nbsp; The treatment of aligned dimensions is a little challenging because you had better not trim or extend the extension lines by differing distances.&amp;nbsp; I guess the solution is to trim or extend both by the shorter of the two distances (if not the same).&amp;nbsp;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I was thinking about that too... I think that length of extension lines of an aligned dim must be the same. So I thought that would be best to convert (redraw) them&amp;nbsp;into a rotated. But I didn't dare to suggest that to ya &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote:&lt;BR /&gt;&lt;P&gt;...&amp;nbsp; I guess the solution is to trim or extend both by the shorter of the two distances (if not the same).&amp;nbsp;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not sure what you mean. If you thinking about shorting both ext lines to the shorter one if the trim line is in different angle, then I would consider that as unexpected behavior and don't like it. I would prefer to convert them into rotated and trim/extend as expected according to trim line..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 07:36:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7960966#M105757</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-04-26T07:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7962704#M105758</link>
      <description>Changing the aligned dimensions to rotated dimensions is the key. My brief&lt;BR /&gt;testing showed that you can't entmod the aligned dimension to rotated, but&lt;BR /&gt;you can use most of the entity dats to entmake a rotated dimension. It&lt;BR /&gt;seems to be just the 70 and 50 codes and the appended '(100 .&lt;BR /&gt;"AcDbRotatedDimension") item. Then the rest of my code works (except for&lt;BR /&gt;extending, but we'll figure that out). Then again, I don't see any need&lt;BR /&gt;for extending except that you think it would be cool. My purpose for this&lt;BR /&gt;exercise is to quickly pull the extension lines away from the guts of the&lt;BR /&gt;swimming pool plan. The extra lines can cause confusion.&lt;BR /&gt;&lt;BR /&gt;Did you notice my "fence" topic? I will incorporate that in place of&lt;BR /&gt;drawing a line/polyline trim boundary.</description>
      <pubDate>Thu, 26 Apr 2018 16:54:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7962704#M105758</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-26T16:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7962844#M105759</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote:&lt;BR /&gt;...my code works (except for&lt;BR /&gt;extending, but we'll figure that out). Then again, I don't see any need&lt;BR /&gt;for extending except that you think it would be cool. My purpose for this&lt;BR /&gt;exercise is to quickly pull the extension lines away from the guts of the&lt;BR /&gt;swimming pool plan. The extra lines can cause confusion.&lt;BR /&gt;....&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You're right, never mind that note. When thinking about that... well I guess sometimes may be that useful, but it does not worth it. Do what your users find useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote:&lt;BR /&gt;Did you notice my "fence" topic? I will incorporate that in place of&lt;BR /&gt;drawing a line/polyline trim boundary.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I did, but didn't get your intension. I would say it could be useful to have [Horizontal/Vertical] options to make trim line by a single click. It could be a temp xline as being more visual, or just a point and xline would be just imaginary.&lt;/P&gt;&lt;P&gt;Not sure about your fence - will try when its done.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 17:49:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7962844#M105759</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-04-26T17:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7963716#M105760</link>
      <description>&lt;P&gt;The fence thing is done, except that I only mentioned but didn't post the required (initget 32) before eACH getpoint.&lt;/P&gt;&lt;P&gt;Add that and you will find it a rather good emulation of the fence selection option mechanics.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 00:11:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7963716#M105760</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-04-27T00:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7978899#M105761</link>
      <description>&lt;P&gt;Well, intersectwith and dimensions really don't work very well, so I emulated them with lines that can be extended, and voila... we have a new routine that sounds like either a weight-loss supplement or a cough formula ("DIMEXTRIM").&lt;/P&gt;&lt;P&gt;At the bottom is a failed attempt at cloning an aligned dimension into a rotated dimension.&amp;nbsp; If you can get that to work then the whole thing would be complete.&amp;nbsp; It doesn't matter much to me since 99% of our dimensions are rotated, but I know that you would like to cover all the bases.&lt;/P&gt;&lt;PRE&gt; ;;  THIS fence one works properly:
  (defun @fence ( / Mspace @getpt @2d p plist obj)
    (setq Mspace (vlax-get (vlax-get (vlax-get-acad-object) 'Activedocument) 'Modelspace))
    (defun @getpt (p)
      (initget 32)
      (if p
        (getpoint p "\nNext fence point: ")
        (getpoint "\nFirst fence point: ")
      )
    )
    (defun @2d (p)(list (car p)(cadr p)))
    (while (setq p (@getpt p))
      (setq plist (reverse (cons (@2d p) (reverse plist))))
      (cond
        ((&amp;lt; (length plist) 2))
        ((= (length plist) 2)
          (setq obj (vlax-invoke Mspace 'AddLightweightPolyline (apply 'append plist)))
          (vlax-put obj 'Color 7)
          (vla-highlight obj 1)
        )
        (obj
          (vlax-put obj 'coordinates (apply 'append plist))
          (vla-highlight obj 1)
        )
        ((prompt "\nSomething is awry."))
      )
    )
    obj
 )

(defun c:DimEXTrim ( / *error* vars vals ss i e obj1 obj2 ints ent p10 p13 p14 p13x p14x)
   ;; (c) 2018, John F. Uhden
   ;; Program trims selected dimensions (extension lines) to a line or polyline.
   (defun *error* (error)
     (mapcar 'setvar vars vals)
     (if obj1 (vla-delete obj1))
     (vla-endundomark *doc*)
     (cond
       ((not error))
       ((wcmatch (strcase error) "*QUIT*,*CANCEL*"))
       (1 (princ (strcat "\nERROR: " error)))
     )
     (princ)
   )
   ;; Function to group a list of items into a list of
   ;; multiple lists, each of length N, e.g.
   ;; '(A B C D E F G H I) -&amp;gt; '((A B C)(D E F)(G H I))
   (defun @group (lst n / item new)
     (foreach element (reverse lst)
       (setq item (cons element item))
       (if (= (length item) n)
         (setq new (cons item new) item nil)
       )
     )
     new
   )
   (defun @ints (obj1 p ang / e obj2 ints)
     (and
       obj1 ang p
       (setq e (entmakex  (list '(0 . "LINE")(cons 10 p)(cons 11 (polar p ang 100))'(60 . 1)))) ;; invisible line
       (setq obj2 (vlax-ename-&amp;gt;vla-object e))
       (setq ints (vlax-invoke obj1 'intersectwith obj2 2)) ;; extend line
       (print (setq ints (@group ints 3)))
       (vla-delete obj2)
     )
     ints
   )
   (setq vars '(cmdecho))
   (setq vals (mapcar 'getvar vars))
   (or *acad* (setq *acad* (vlax-get-acad-object)))
   (or *doc* (setq *doc* (vla-get-ActiveDocument *acad*)))
   (vla-endundomark *doc*)
   (vla-startundomark *doc*)
   (mapcar 'setvar vars '(0))
   (command "_.expert" (getvar "expert")) ;; dummy command
   (and
     (princ "\nSelect rotated dimensions to trim: ")
     (setq ss (ssget '((0 . "DIMENSION")(100 . "AcDbRotatedDimension"))))
     (setq obj1 (@fence))
     (repeat (setq i (sslength ss))
       (and
         (setq e (ssname ss (setq i (1- i))))
         (setq ent (entget e))
         (setq p10 (cdr (assoc 10 ent)))
         (setq p13 (cdr (assoc 13 ent)))
         (setq p14 (cdr (assoc 14 ent)))
         (setq ang (angle p10 p14))
         (not (setq p13x nil p14x nil))
         (foreach p (@ints obj1 p13 ang)
           (if (or (not p13x)(&amp;lt; (distance p13 p)(distance p13 p13x)))
              (setq p13x p)
            )
            1
         )
         (foreach p (@ints obj1 p14 ang)
           (if (or (not p14x)(&amp;lt; (distance p14 p)(distance p14 p14x)))
              (setq p14x p)
            )
           1
         )
         (if p13x (entmakex (list '(0 . "TEXT")(cons 10 p13x)'(1 . "P13X")'(62 . 1)'(40 . 12))) 1)
         (if p14x (entmakex (list '(0 . "TEXT")(cons 10 p14x)'(1 . "P14X")'(62 . 1)'(40 . 12))) 1)
         (if p13x (setq ent (subst (cons 13 p13x)(assoc 13 ent) ent)) 1)
         (if p14x (setq ent (subst (cons 14 p14x)(assoc 14 ent) ent)) 1)
         (entmod ent)
         (entupd e)
       )
     )
   )
   (*error* nil)
)
(defun c:DXT ()(c:DimEXTrim))
&lt;BR /&gt;;; This was just for labeling the dimension DXF points.
(defun c:dxfdata ( / e ent p)
  (and
    (setq e (car (entsel)))
    (setq ent (entget e))
    (foreach dxf '(10 13 14)
      (and
        (setq p (cdr (assoc dxf ent)))
        (entmakex (list '(0 . "TEXT")(cons 10 p)(cons 1 (itoa dxf))'(62 . 1)'(40 . 12)))
      )
    )
  )
)

;| Aligned dimension:
((-1 . &amp;lt;Entity name: 400c8b60&amp;gt;) (0 . "DIMENSION") (330 . &amp;lt;Entity 
name: 40082cf8&amp;gt;) (5 . "594") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . 
"0") (100 . "AcDbDimension") (2 . "*D10") (10 634.893 15.3274 0.0) (11 561.055 
105.228 0.0) (12 0.0 0.0 0.0) (70 . 33) (1 . "") (71 . 5) (72 . 1) (41 . 1.0) 
(42 . 232.673) (52 . 0.0) (53 . 0.0) (54 . 0.0) (51 . 0.0) (210 0.0 0.0 1.0) (3 
. "Standard") (100 . "AcDbAlignedDimension") (13 413.705 134.752 0.0) (14 
561.38 -45.05 0.0) (15 0.0 0.0 0.0) (16 0.0 0.0 0.0) (40 . 0.0) (50 . 0.0))


;; Duplicate rotated dimension:
 ((-1 . &amp;lt;Entity name: 400c8c10&amp;gt;) (0 . "DIMENSION") (330 . &amp;lt;Entity 
name: 40082cf8&amp;gt;) (5 . "5A2") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . 
"0") (100 . "AcDbDimension") (2 . "*D11") (10 634.893 15.3274 0.0) (11 561.055 
105.228 0.0) (12 0.0 0.0 0.0) (70 . 32) (1 . "") (71 . 5) (72 . 1) (41 . 1.0) 
(42 . 232.673) (52 . 0.0) (53 . 0.0) (54 . 0.0) (51 . 0.0) (210 0.0 0.0 1.0) (3 
. "Standard") (100 . "AcDbAlignedDimension") (13 413.705 134.752 0.0) (14 
561.38 -45.05 0.0) (15 0.0 0.0 0.0) (16 0.0 0.0 0.0) (40 . 0.0) (50 . 5.4) (100 
. "AcDbRotatedDimension"))
|;&lt;BR /&gt;
;; Nice try, but it doesn't work...
(defun @aligned2rotated (e / -ent flag ang rotated)
  (and
    (= (type e) 'ENAME)
    (setq ent (entget e))
    (setq flag (cdr (assoc 70 ent)))
    (= (logand flag 1) 1) ;; aligned [I think]
    (setq ent (vl-remove-if '(lambda (x)(vl-position (car x)'(-1 5))) ent))
    (setq ent (subst '( 2 . "*D")(assoc 2 ent) ent))
    (setq ent (subst (cons 70 (boole 2 flag 1))(assoc 70 ent) ent))
    (setq ang (angle (cdr (assoc 13 ent))(cdr (assoc 14 ent))))
    (setq ent (subst (cons 50 ang)(assoc 50 ent) ent))
    (setq ent (append ent '((100 . "AcDbRotatedDimension"))))
    (or (entdel e) 1)
    (setq rotated (entmake ent))
  )
  rotated
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 May 2018 22:47:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7978899#M105761</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-05-03T22:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7979530#M105762</link>
      <description>&lt;P&gt;Nice work!! Thanks!&amp;nbsp;Appreciate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;At the bottom is a failed attempt at cloning an aligned dimension into a rotated dimension.&amp;nbsp; If you can get that to work then the whole thing would be complete....&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It looks like the only issue is a name. It works with this line commented out:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    ;;; (setq ent (subst '(2 . "*D")(assoc 2 ent) ent))&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 May 2018 08:00:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7979530#M105762</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-05-04T08:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7980092#M105763</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;wrote: "&lt;/P&gt;&lt;P&gt;It looks like the only issue is a name. It works with this line commented out:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    ;;; (setq ent (subst '(2 . "*D")(assoc 2 ent) ent))"&lt;/PRE&gt;&lt;P&gt;That's interesting.&amp;nbsp; I think that you need to use just "*U" when creating an anonymous block (AutoCAD automatically adds the numeric suffix), so I thought the same rule applied to dims, which are really just a particular anonymous block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm actually working right now (well, not this second obviously) so I'll try to wrap it up tonight or over the weekend.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 12:45:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7980092#M105763</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-05-04T12:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7980295#M105764</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Well, intersectwith and dimensions really don't work very well, so I emulated them with lines that can be extended....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since this is always straight-line elements, you should be able to use &lt;FONT color="#000000"&gt;&lt;STRONG&gt;(inters)&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;with the various known points, and a little &lt;STRONG&gt;&lt;FONT color="#000000"&gt;(polar)&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;to find a fourth one in some instances, to find appropriate locations, rather than drawing temporary Lines and using (...intersectwith...) methods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the approach in &lt;FONT color="#000000"&gt;&lt;STRONG&gt;DimExtLineToggle.lsp&lt;/STRONG&gt;&lt;/FONT&gt;, available &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/can-i-toggle/m-p/2332828/highlight/true#M266392" target="_blank"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;, at the setting of the ar1 variable in the (T) condition for linear Dimensions.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 13:58:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7980295#M105764</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-05-04T13:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7980315#M105765</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;.....&amp;nbsp; The first thing I will have to do is figure out how to recognize the difference between an aligned dimension and an orthogonal dimension, and whatever the others are.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There's code to make all those distinctions&amp;nbsp;in &lt;FONT color="#000000"&gt;&lt;STRONG&gt;MakeMore.lsp&lt;/STRONG&gt;&lt;/FONT&gt;, available &lt;A href="http://cadtips.cadalyst.com/match-properties/make-new-objects-with-existing-objects-properties" target="_blank"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 13:56:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7980315#M105765</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-05-04T13:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7981155#M105766</link>
      <description>&lt;P&gt;Just inters would be fine if the boundary was just a line, but I decided to make a polyline boundary from my&amp;nbsp;@fence function.&amp;nbsp; I do have an&amp;nbsp;@inters2d function to intersect&amp;nbsp; a point and angle with a 2D polyline (mathematically), but the code is too lengthy&amp;nbsp; for most folks 'round these parts, plus it handles bulged segments which I don't need for this Dim thingy.&amp;nbsp; I am quite happy with this technique here, except for the aligned dimensions.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 19:01:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7981155#M105766</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-05-04T19:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7981723#M105767</link>
      <description>&lt;P&gt;My&amp;nbsp;@aligned2rotated function dosen't work for me even after commenting out the dim name change.&lt;/P&gt;&lt;P&gt;Could you make it work, please?&amp;nbsp; Pretty please?&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 01:48:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7981723#M105767</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-05-05T01:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7981938#M105768</link>
      <description>&lt;P&gt;Hmm, can't really help since that line is only one that really matters (ACAD 2018). You can try to play with omitting other codes (dicts...) but it makes no difference to me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried that on some real drawing... all DimAligned were converted successfully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun @aligned2rotated (e / -ent flag ang rotated)
  (and
    (= (type e) 'ENAME)
    (setq ent (entget e))
    (setq flag (cdr (assoc 70 ent)))
    (= (logand flag 1) 1) ;; aligned [I think]
    (setq ent (vl-remove-if '(lambda (x) (vl-position (car x)'(
							       -1
							       ;2 ; better stay the same
							       5
							       102
							       330
							       360
							       ))) ent))
    ;(setq ent (subst '( 2 . "*D")(assoc 2 ent) ent))
    (setq ent (subst (cons 70 (boole 2 flag 1))(assoc 70 ent) ent))
    (setq ang (angle (cdr (assoc 13 ent))(cdr (assoc 14 ent))))
    (setq ent (subst (cons 50 ang)(assoc 50 ent) ent))
    (setq ent (append ent '((100 . "AcDbRotatedDimension"))))
    (or (entdel e) 1)
    (setq rotated (entmake ent))
  )
  rotated
)

(defun c:DimAli2Rot ( / ss i n)
  (if (setq n 0
	    ss (ssget))
    (repeat (setq i (sslength ss))
      (if (@aligned2rotated (ssname ss (setq i (1- i))))
	(setq n (1+ n)))))
  (print n) (princ " dims converted.")
  (princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If that's still not work, try&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/entmake-dimension/m-p/1163970#M164472" target="_blank"&gt;THIS&lt;/A&gt;&amp;nbsp;well-working code as a minimum...&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 08:24:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7981938#M105768</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-05-05T08:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7983503#M105769</link>
      <description>&lt;P&gt;Thanks to your inspirational responses, I think I have it all worked out.&amp;nbsp; Yes, it extends and trims and converts aligned to rotated.&amp;nbsp; It might also relieve cold symptoms and help one lose weight.&lt;/P&gt;&lt;PRE&gt;;;  Function to create a polyline emulating the fence selection mechanism:
(defun @fence ( / @getpt @2d p plist obj)
    (if (not MSpace)
      (setq Mspace (vlax-get (vlax-get (vlax-get-acad-object) 'Activedocument) 'Modelspace))
    )
    (defun @getpt (p)
      (initget 32)
      (if p
        (getpoint p "\nNext fence point: ")
        (getpoint "\nFirst fence point: ")
      )
    )
    (defun @2d (p)(list (car p)(cadr p)))
    (while (setq p (@getpt p))
      (setq plist (reverse (cons (@2d p) (reverse plist))))
      (cond
        ((&amp;lt; (length plist) 2))
        ((= (length plist) 2)
          (setq obj (vlax-invoke Mspace 'AddLightweightPolyline (apply 'append plist)))
          (vlax-put obj 'Color 7)
          (vla-highlight obj 1)
        )
        (obj
          (vlax-put obj 'coordinates (apply 'append plist))
          (vla-highlight obj 1)
        )
        ((prompt "\nSomething is awry."))
      )
    )
    obj
 )

(defun c:DimEXTrim ( / *error* @group @ints @aligned2rotated MSpace
                                            vars vals ss i e obj1 obj2 ints ent p10 p13 p14 p13x p14x)
   ;; (c) 2018, John F. Uhden
   ;; Program trims selected dimensions (extension lines) to a polyline fence.
   (defun *error* (error)
     (mapcar 'setvar vars vals)
     (if obj1 (vla-delete obj1))
     (vla-endundomark *doc*)
     (cond
       ((not error))
       ((wcmatch (strcase error) "*QUIT*,*CANCEL*"))
       (1 (princ (strcat "\nERROR: " error)))
     )
     (princ)
   )
   ;; Function to group a list of items into a list of
   ;; multiple lists, each of length N, e.g.
   ;; '(A B C D E F G H I) -&amp;gt; '((A B C)(D E F)(G H I))
   (defun @group (lst n / item new)
     (foreach element (reverse lst)
       (setq item (cons element item))
       (if (= (length item) n)
         (setq new (cons item new) item nil)
       )
     )
     new
   )
   (defun @ints (obj1 p ang / e obj2 ints)
     (and
       obj1 ang p
       (setq e (entmakex  (list '(0 . "LINE")(cons 10 p)(cons 11 (polar p ang 100))'(60 . 1)))) ;; invisible line
       (setq obj2 (vlax-ename-&amp;gt;vla-object e))
       (setq ints (vlax-invoke obj1 'intersectwith obj2 2)) ;; extend line
       (setq ints (@group ints 3))
       (vla-delete obj2)
     )
     ints
   )
  ;; This one works (05-06-18):
  (defun @aligned2rotated (e / old new flag p13 p14 p10 obj)
    (and
      (= (type e) 'ENAME)
      (setq old (entget e '("*")))
      (setq flag (cdr (assoc 70 old)))
      (= (logand flag 1) 1) ;; aligned
      (setq p13 (cdr (assoc 13 old)))
      (setq p14 (cdr (assoc 14 old)))
      (setq p10 (cdr (assoc 10 old)))
      (setq obj (vlax-invoke MSpace 'addDimRotated p13 p14 p10 (angle p13 p14)))
      (setq new (entget (vlax-vla-object-&amp;gt;ename obj)))
      (foreach dxf '(8 11 71 72 41 42 52 53 54 51 210 3 15 16 40 -3)
        (setq new (subst (assoc dxf old)(assoc dxf new) new))
      )
      (if (not (assoc -3 new))
        (setq new (append new (list (assoc -3 old)))) ;; overrides
      )
      (entmod new)
      (entdel e)
    )
    new
  )
  (setq Mspace (vlax-get (vlax-get (vlax-get-acad-object) 'Activedocument) 'Modelspace))
  (setq vars '(cmdecho))
   (setq vals (mapcar 'getvar vars))
   (or *acad* (setq *acad* (vlax-get-acad-object)))
   (or *doc* (setq *doc* (vla-get-ActiveDocument *acad*)))
   (vla-endundomark *doc*)
   (vla-startundomark *doc*)
   (mapcar 'setvar vars '(0))
   (command "_.expert" (getvar "expert")) ;; dummy command
   (and
     (princ "\nSelect rotated dimensions to trim: ")
     (setq ss (ssget '((0 . "DIMENSION")(100 . "AcDbAlignedDimension"))))
     (setq obj1 (@fence))
     (repeat (setq i (sslength ss))
       (and
         (setq e (ssname ss (setq i (1- i))))
         (setq ent (entget e))
         (or
           (vl-position '(100 . "AcDbRotatedDimension") ent)
           (setq ent (@aligned2rotated e))
         )
         (setq p10 (cdr (assoc 10 ent)))
         (setq p13 (cdr (assoc 13 ent)))
         (setq p14 (cdr (assoc 14 ent)))
         (setq ang (angle p10 p14))
         (not (setq p13x nil p14x nil))
         (foreach p (@ints obj1 p13 ang)
           (if (or (not p13x)(&amp;lt; (distance p13 p)(distance p13 p13x)))
              (setq p13x p)
            )
            1
         )
         (foreach p (@ints obj1 p14 ang)
           (if (or (not p14x)(&amp;lt; (distance p14 p)(distance p14 p14x)))
              (setq p14x p)
            )
           1
         )
    ;;  The following two lines were for testing only:
    ;;     (if p13x (entmakex (list '(0 . "TEXT")(cons 10 p13x)'(1 . "P13X")'(62 . 1)'(40 . 12))) 1)
    ;;     (if p14x (entmakex (list '(0 . "TEXT")(cons 10 p14x)'(1 . "P14X")'(62 . 1)'(40 . 12))) 1)
         (if p13x (setq ent (subst (cons 13 p13x)(assoc 13 ent) ent)) 1)
         (if p14x (setq ent (subst (cons 14 p14x)(assoc 14 ent) ent)) 1)
         (entmod ent)
         (entupd e)
       )
     )
   )
   (*error* nil)
)
(defun c:DXT ()(c:DimEXTrim))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 01:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7983503#M105769</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-05-07T01:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension Entity Data</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7985202#M105770</link>
      <description>&lt;P&gt;Aw, c'mon, Uhden.&lt;/P&gt;&lt;P&gt;Rather than to keep making and then deleting lines, just make one and keep modifying it.&lt;/P&gt;&lt;P&gt;Otherwise you may run out of handles.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 16:42:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimension-entity-data/m-p/7985202#M105770</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-05-07T16:42:18Z</dc:date>
    </item>
  </channel>
</rss>

