0 Members and 1 Guest are viewing this topic.
[color=green];; bd1.lsp[/color](defun [color=blue]c:bd1[/color] (/ Limit Pre Pt1 Sel Xpt1 Ypt1) (vl-load-com) [color=green];; sample by kdub@theSwamp ;; Select an object at or in in a relative position to the selected Point. ;; If the Object is not found, change the point negative X vector 0.01 ;; untill the search limit is reached ;; Will only select object if the point is ON screen.[/color] (setq pt1 (getpoint [color=Maroon]"\nPoint to Test:"[/color]) pre 0.01 xpt1 (car pt1) ypt1 (cadr pt1) limit (- xpt1 15) ) (vl-cmdf [color=Maroon]"zoom"[/color] [color=Maroon]"E"[/color]) (while (and (> xpt1 limit) (not (setq SEL (nentselp [color=Maroon]""[/color] (list xpt1 ypt1)))) ) (setq xpt1 (- xpt1 pre)) ) (vl-cmdf [color=Maroon]"zoom"[/color] [color=Maroon]"P"[/color]) SEL)
if I remove the vl-cmdf parts it gives me the coordinate of the object I want to select
I removed the declared variable sel to test from the command line what entity it was but it isn't the one I wantBut if I remove the vl-cmdf parts it selects the entity I expect it to select, it if is on screen
But if I remove the vl-cmdf parts it selects the entity I expect it to select, it if is on screen
I removed the declared variable sel to test from the command line what entity it was but it isn't the one I want
I guess I have found out what I was doing wrongI was testing without a closed object, when I try your routine with a closed polyline it works
but when I don't use a closed object it doesn't select the next object in the -x directionI'm sorry for all the trouble