Dimension Entity Data

Dimension Entity Data

john.uhden
Mentor Mentor
3,572 Views
19 Replies
Message 1 of 20

Dimension Entity Data

john.uhden
Mentor
Mentor

I have been inspecting the contents of dimension entity data towards making a TrimDim command.  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.  It's annoying to see all the gripping and stretching, so I intend to give them a more powerful tool that will save time.  No, I am not worried about losing associativity.  They thoroughly check all the dimensions before labeling.  The labels are for the record and QC inspection with a plan view being returned to the customer.

It appears that the 13 and 14 codes represent the endpoints of the extension lines, but not the nearby dimension points.  I would really like to get the points, if possible.  Then there is a 10 code for the right end of the dimension (arrowhead) but none for the left end.

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.

John F. Uhden

0 Likes
Accepted solutions (1)
3,573 Views
19 Replies
Replies (19)
Message 2 of 20

john.uhden
Mentor
Mentor

Plus, the only point data in its vla-object properties is TextPosition.

My mistake... upon closer inspection, the 13 and 14 codes ARE the dimension points, and they can be entmoded.

I will solve this myself.

Anyone want to try it when it's done?

John F. Uhden

Message 3 of 20

john.uhden
Mentor
Mentor
Accepted solution
(defun c:TrimDim ( / *error* vars vals ss i e1 e2 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) (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) -> '((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->vla-object e1) obj2 (vlax-ename->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)(< (distance p13 p)(distance p13 p13x))) (setq p13x p) ) ) (if (equal (angle p14 p) ang 1e-3) (if (or (not p14x)(< (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))

@john.uhdenwrote:

Plus, the only point data in its vla-object properties is TextPosition.

My mistake... upon closer inspection, the 13 and 14 codes ARE the dimension points, and they can be entmoded.

I will solve this myself.

Anyone want to try it when it's done?


 

John F. Uhden

Message 4 of 20

ВeekeeCZ
Consultant
Consultant

Hi John, I like the idea... looks like the routine may be useful to me as well 😉

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....

Message 5 of 20

john.uhden
Mentor
Mentor
I'll work on it *(after I build a trestle table to relocate my laptop to my
bedroom so that I can be exiled from the fun room).*

John F. Uhden

0 Likes
Message 6 of 20

john.uhden
Mentor
Mentor

Hmmm.  The treatment of aligned dimensions is a little challenging because you had better not trim or extend the extension lines by differing distances.  I guess the solution is to trim or extend both by the shorter of the two distances (if not the same).  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.

John F. Uhden

0 Likes
Message 7 of 20

ВeekeeCZ
Consultant
Consultant

@john.uhdenwrote:

Hmmm.  The treatment of aligned dimensions is a little challenging because you had better not trim or extend the extension lines by differing distances.  I guess the solution is to trim or extend both by the shorter of the two distances (if not the same). ...


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 into a rotated. But I didn't dare to suggest that to ya 😉

 


@john.uhdenwrote:

...  I guess the solution is to trim or extend both by the shorter of the two distances (if not the same). ...


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.. 

 

0 Likes
Message 8 of 20

john.uhden
Mentor
Mentor
Changing the aligned dimensions to rotated dimensions is the key. My brief
testing showed that you can't entmod the aligned dimension to rotated, but
you can use most of the entity dats to entmake a rotated dimension. It
seems to be just the 70 and 50 codes and the appended '(100 .
"AcDbRotatedDimension") item. Then the rest of my code works (except for
extending, but we'll figure that out). Then again, I don't see any need
for extending except that you think it would be cool. My purpose for this
exercise is to quickly pull the extension lines away from the guts of the
swimming pool plan. The extra lines can cause confusion.

Did you notice my "fence" topic? I will incorporate that in place of
drawing a line/polyline trim boundary.

John F. Uhden

0 Likes
Message 9 of 20

ВeekeeCZ
Consultant
Consultant

@john.uhdenwrote:
...my code works (except for
extending, but we'll figure that out). Then again, I don't see any need
for extending except that you think it would be cool. My purpose for this
exercise is to quickly pull the extension lines away from the guts of the
swimming pool plan. The extra lines can cause confusion.
....

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.

 


@john.uhdenwrote:
Did you notice my "fence" topic? I will incorporate that in place of
drawing a line/polyline trim boundary.

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.

Not sure about your fence - will try when its done.

0 Likes
Message 10 of 20

john.uhden
Mentor
Mentor

The fence thing is done, except that I only mentioned but didn't post the required (initget 32) before eACH getpoint.

Add that and you will find it a rather good emulation of the fence selection option mechanics.

John F. Uhden

0 Likes
Message 11 of 20

john.uhden
Mentor
Mentor

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").

At the bottom is a failed attempt at cloning an aligned dimension into a rotated dimension.  If you can get that to work then the whole thing would be complete.  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.

 ;;  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
        ((< (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) -> '((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->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)(< (distance p13 p)(distance p13 p13x)))
              (setq p13x p)
            )
            1
         )
         (foreach p (@ints obj1 p14 ang)
           (if (or (not p14x)(< (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))

;; 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 . <Entity name: 400c8b60>) (0 . "DIMENSION") (330 . <Entity name: 40082cf8>) (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 . <Entity name: 400c8c10>) (0 . "DIMENSION") (330 . <Entity name: 40082cf8>) (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")) |;
;; 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 )

John F. Uhden

Message 12 of 20

ВeekeeCZ
Consultant
Consultant

Nice work!! Thanks! Appreciate.

 


@john.uhdenwrote:

...

At the bottom is a failed attempt at cloning an aligned dimension into a rotated dimension.  If you can get that to work then the whole thing would be complete....


It looks like the only issue is a name. It works with this line commented out: 

    ;;; (setq ent (subst '(2 . "*D")(assoc 2 ent) ent))
0 Likes
Message 13 of 20

john.uhden
Mentor
Mentor

@ВeekeeCZwrote: "

It looks like the only issue is a name. It works with this line commented out: 

    ;;; (setq ent (subst '(2 . "*D")(assoc 2 ent) ent))"

That's interesting.  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.

 

I'm actually working right now (well, not this second obviously) so I'll try to wrap it up tonight or over the weekend. 

John F. Uhden

0 Likes
Message 14 of 20

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:

Well, intersectwith and dimensions really don't work very well, so I emulated them with lines that can be extended....


Since this is always straight-line elements, you should be able to use (inters) with the various known points, and a little (polar) to find a fourth one in some instances, to find appropriate locations, rather than drawing temporary Lines and using (...intersectwith...) methods.

 

That's the approach in DimExtLineToggle.lsp, available >here<, at the setting of the ar1 variable in the (T) condition for linear Dimensions.

Kent Cooper, AIA
0 Likes
Message 15 of 20

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:

.....  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.


There's code to make all those distinctions in MakeMore.lsp, available >here<.

Kent Cooper, AIA
0 Likes
Message 16 of 20

john.uhden
Mentor
Mentor

Just inters would be fine if the boundary was just a line, but I decided to make a polyline boundary from my @fence function.  I do have an @inters2d function to intersect  a point and angle with a 2D polyline (mathematically), but the code is too lengthy  for most folks 'round these parts, plus it handles bulged segments which I don't need for this Dim thingy.  I am quite happy with this technique here, except for the aligned dimensions.

John F. Uhden

0 Likes
Message 17 of 20

john.uhden
Mentor
Mentor

My @aligned2rotated function dosen't work for me even after commenting out the dim name change.

Could you make it work, please?  Pretty please?

John F. Uhden

0 Likes
Message 18 of 20

ВeekeeCZ
Consultant
Consultant

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. 

I've tried that on some real drawing... all DimAligned were converted successfully.

 

(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)
)

 If that's still not work, try THIS well-working code as a minimum...

0 Likes
Message 19 of 20

john.uhden
Mentor
Mentor

Thanks to your inspirational responses, I think I have it all worked out.  Yes, it extends and trims and converts aligned to rotated.  It might also relieve cold symptoms and help one lose weight.

;;  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
        ((< (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) -> '((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->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->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)(< (distance p13 p)(distance p13 p13x)))
              (setq p13x p)
            )
            1
         )
         (foreach p (@ints obj1 p14 ang)
           (if (or (not p14x)(< (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))


 

John F. Uhden

0 Likes
Message 20 of 20

john.uhden
Mentor
Mentor

Aw, c'mon, Uhden.

Rather than to keep making and then deleting lines, just make one and keep modifying it.

Otherwise you may run out of handles.  😕

John F. Uhden

0 Likes