Hello again!
New function, new problem 😉
(defun c:pts_autour_voile ()
(setq accrochage (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setq contour_polyligne(car(entsel "\nSelect a polyline :")))
(if (= contour_polyligne nil)
(princ "\nYou havent selected anything")
(progn
(setq defpolyligne (ENTGET contour_polyligne))
(setq ent_polyligne ( cdr (ASSOC 8 defpolyligne)))
(if (= ent_polyligne "Polyligne_Concrete")
(progn
(foreach rec defpolyligne
(if (= (car rec) 10)
(progn
(setq points (append points (list (cdr rec))))
(setq Xpoints (append Xpoints (list (cadr rec))))
(setq Ypoints (append Ypoints (list (caddr rec))))
);fprogn
) ;endif
) ;endforeach
(setq x (+ (apply 'max Xpoints) 1))
(setq y (+ (apply 'max Ypoints) 1))
(setq pointmax (list X Y))
(print x)
(print y)
(command "decaler" "0.1" contour_polyligne pointmax "")
(setq contour_polyligne2 (entlast))
(setq defpolyligne2 (ENTGET contour_polyligne2))
(setq ent_polyligne2 ( cdr (ASSOC 8 defpolyligne)))
(if (= ent_polyligne2 "Polyligne_Concrete")
(progn
(foreach rec2 defpolyligne2
(if (= (car rec2) 10)
(progn
(setq points2 (append points2(list (cdr rec2))))
(setq points_autour (ssget "_CP" points2))
(print points_autour)
);progn
);endif
);foreach
);progn
);endif
) ;fprogn
(princ "\nyou havent selected a polyline")
) ;endif
) ;fprogn
) ;endif
(princ)
(setvar "OSMODE" accrochage)
)
Why is 'points_autour' empty ??? 😞
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@stelios16 wrote:
....
(command "decaler" "0.1" contour_polyligne pointmax "")
(setq contour_polyligne2 (entlast))
....
I don't know what the English equivalent command name for "decaler" is, but [judging from an on-line French-English dictionary] if it's Scale or Move, then:
1. If it's Scale, it looks like the answers to the command prompts are in the wrong order; if it's Move, the same is true and the 0.1 isn't enough to specify where to move it.
2. The Polyline scaled or moved won't necessarily be (entlast). If that's the problem, whatever (entlast) really is may have something that can be put into the point2 variable, but probably not anything relevant to the routine, and maybe [if it's something like a Line or Text or a Block] only one point, which doesn't make a good crossing polygon for selection.
If "decaler" is Copy, there would be a new object that would be (entlast), but it would have the same command-prompt-answer problems as with Move.