The entsel looping stop after 1 loop

The entsel looping stop after 1 loop

nam.lethai1995
Enthusiast Enthusiast
281 Views
3 Replies
Message 1 of 4

The entsel looping stop after 1 loop

nam.lethai1995
Enthusiast
Enthusiast
Try to write a simple code but it turn out that the are more and more problem keep showing up.
(while (not (equal (setq ent (entsel)) nil))
  (progn
    (setq dxf (entget (car ent)))
    (setq start (cdr (assoc 10 dxf)))
    (setq end (cdr (assoc 11 dxf)))
    (command "dimaligned" start end)
    (princ)
  )
)
0 Likes
Accepted solutions (1)
282 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor

how's about try:

(while (setq ent (entsel))


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 4

hoseobshim
Contributor
Contributor

perfect solutiion by Kent1Cooper

Message 4 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

Dimensioning commands have a <select object> default that you can take advantage of -- hit Enter "" for that option, and feed in the selection, so that you don't need to extract the start and end points of a Line [clearly the object you're selecting]:

 

(while (setq lin (entsel "\nSelect Line or  for Aligned Dimension: "))

  (command "_dimaligned" "" lin pause)

)

Kent Cooper, AIA