Selecting multiple extension line functionality help

Selecting multiple extension line functionality help

adkstorm
Participant Participant
3,030 Views
21 Replies
Message 1 of 22

Selecting multiple extension line functionality help

adkstorm
Participant
Participant

Have this routine I use often, but it only allows you to select one extension line. I would like to be able to select multiple, so I don't have to repeat the routine for each extension line I select.

 

(defun c:nox(/ notdim stillon tryext oce es en pt ed)
  ;Return T if <edata> is not a dimension
  (defun notdim (edata)
   (/= "DIMENSION" (cdr (assoc 0 edata))))
 (defun stillon (edata pnt / ssp)
  (if (setq ssp (ssget pnt))
   (equal
    (cdr (assoc -1 edata))
    (ssname ssp 0))))
 ;Return T if extension goes away, nil otherwise
 (defun tryext (extnum edata pnt)
  (command "dim" "override" (strcat "dimse" (itoa extnum)) "on" "" en "")
  (cond
   ((stillon edata pt)
    (command "undo" "exit")
    nil)
   (t
    (command "exit")
    'T)))
 ;Main:
 (setq oce (getvar "cmdecho"))
 (setvar "cmdecho" 0)
 (command "undo" "g")
 (if (setq es (entsel "\nPick extension line to suppress: "))
  (progn
   (setq
    en (car es)
    pt (cadr es)
    ed (entget en))
   (cond
    ((notdim ed)
     (princ "\nNot a dimension."))
    ((tryext 1 ed pt))
    ((tryext 2 ed pt))
    ((princ "\nNot an extension line.")))))
 (command "undo" "e")
 (setvar "cmdecho" oce)
 (princ))
0 Likes
Accepted solutions (1)
3,031 Views
21 Replies
Replies (21)
Message 21 of 22

Kent1Cooper
Consultant
Consultant

@anton_chmidt wrote:
.... sometimes there is as much as 8 overlapping dimensions ....

... which means, since their dimension-line positions surely do not coincide, the problem in Message 17 will occur.  I still think what should happen is to assign the non-continuous linetype to the longest one, and suppress the others.  But even that is not reliable unless they all spring from the same definition point.

 

But I'm still stuck with the fact that selection on multiple coinciding extension lines sometimes doesn't "see" all of them.  I will try some more to figure that out, but I'm not sure I'll find an answer.

Kent Cooper, AIA
0 Likes
Message 22 of 22

anton_chmidt
Advocate
Advocate

Yet even with those 8 overlapping dimension. If I run this lisp 7 Times, selecting each time different dim, it works perfectly. So for any reason the issue you are describing is not happening. Maybe the linetypes I use work some how differently, I mostly use different sized simple dash patterns? 

0 Likes