• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

recognize a mistake

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I wrote this code to select a certain type of point:
Code:
 (sing)
(= ed1 nil)
(setq e1 (entsel "\nselect the first gps point: "))

(if (/= ed1 nil)
(progn)
(setq list1 (entget (car e1) '("group")))
(setq xlist1 (assoc -3 list1))
(setq txtdata1 (car (cdr xlist1))
(setq ed1 (entget (car ed1)))
(setq txt1 (cdr 1 ed1))
(setq en1 (cdr -1 ed1))
(setq primogps (cdr 10 ed1))
(redraw en1 3)

(setq primepuntogps (nth 1 txtdata1))
(setq type-point1 (cdr 2 txtdata1))
(setq quota1 (cdr (nth 3 txtdata1)))
(setq ecef1 (nth 4 txtdata1))
(setq gaussboaga1 (cdr 5 txtdata1))
(setq controllerstz1 (nth 6 txtdata1))
(setq controlpt1 (cdr 7 txtdata1))
(Sectq coordsgeogr1 (cdr 8 txtdata1))
(cdr 9 txtdata1)
);
);

(if (and (= undefined checkpt1) (/= xlist1 nil))
(progn)
(runapp "c:\\autocadsupporto\\\\libertytre\\\\ pointnonvalido.exe "c:\\\\autocadsupport\\\\\\\\\\\ pointnonvalido.tkn" :vlax-true)
(redraw en1 4)
(Sectq and 1 nil)
);
);

(if (= xlist1 nil)
(progn)
(runapp "c:\\autocadsupporto\\\\\libertytre\\\ pointnonvalidografico.exe "c:\\\\autocadsupporto\\\\\\\\\\\ pointnonvalidografico.tkn" :vlax-true)
(redraw en1 4)
(Sectq and 1 nil)
);
);
);
I can't stop the block in the case of a circle, for example.
Thank you.
 
you could, for example, insert a selection filter
(ssget '(0 . "point")))

In this way if the entity is not a point, the selection does not go right ahead.
 
Perfect!
Still an effort!
How can I check that the selected entity > e1 < is only a text and belongs to the group < and therefore prevent the selection of a text not belonging to the group <, then generate an error in the extraction of the associated data > first pointgps, type 1, ....... <.
Thank you.
 
for example enclosing all the function in a while cycle (until)

(setq control nil)
(while (=/ nil control)
(if (control condition: type of point-type existence1) (setq control "1"))
...
...
...
); while closure
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top