Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Solved by pbejse. Go to Solution.
try this
(setq pt '(2.0 2.0) fuz 1.0);<---- fuz value
(setq ss (ssget "C" (polar pt (* pi 0.25) (* fuz (sqrt 2))) (polar pt (* pi 1.25) (* fuz (sqrt 2)))))
fuz = range, with thi example it will select a window at '(1.0 1.0) and '(3.0 3.0)
fuz value of 0.5 '(2.5 2.5) and '(1.5 1.5)
The bigger the fuz the larger the crossing selection
if you need to fiilter entity type
(setq pt '(2.0 2.0) fuz 0.01 typ "LINE");<-- options (setq ss (ssget "C" (polar pt (* pi 0.25) (* fuz (sqrt 2))) (polar pt (* pi 1.25) (* fuz (sqrt 2))) (list (cons 0 typ))))
You can add as many filter you want.
(setq ss (ssget "C" (polar pt (* pi 0.25) (* fuz (sqrt 2))) (polar pt (* pi 1.25) (* fuz (sqrt 2))) '((0 . "LINE")(8 . "YourLayer"))));<--filter
Hope this helps
HI,
thank you very much for your help.
range trick does well.
Regards,
G
@ProfWolfMan wrote:....
I am trying to select all objects passing thru a apecified point as like below.
(ssget '(2 2))i have three lines sharing coommon start point as (2 2).but above code returns only latest object.I expect selection set of all three objects.....
The "fuzz factor" approach is good if it's possible that the objects might not all land precisely on or pass precisely through the point. But if your Lines really do all start [or end] at a common point, or more generally, if any objects really do pass exactly through one, you can use that point itself twice, for both corners of a Crossing window, without a fuzz factor:
(ssget "c" '(2 2 0) '(2 2 0))
and it will find all of the objects.
@Kent1Cooper wrote:
(ssget "c" '(2 2 0) '(2 2 0))
and it will find all of the objects.
I never knew that. i'm so retarded
Nice kent
Hi,
Excellent and simple for my case.
as itold i am in a situation that all lines are start at same point.
so, without fuzz your method is simple. Thanks for your logic.
and also i learnt about fuzz factor from this thread. once again thanks to you both.
Is it depends on zoom level?
Actually i tried this but i get different answers as zoom changes......
Know that the coordinates must be in the viewing area,
ie, on the screen, to collect the objects.
Do not know the zoom magnitude parameters,
we only zoomed if necessary.
John Uhden provides a method at
http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ssget-failure/td-p/2393234
and comments at
Google still works wonders at mining info.
hi kent
i followed your instruction but it does not work for me.
might be i mistaken
actually i want to use overkill command in order to delete the merge line.
(command "overkill" (setq pnt (ssget "c" '(2,2,0) '(2,2,0)) '(0 . "line")) "")
this is i actually used.
this is original lisp
(defun c:111 ()
(defun *error* (msg)
(if (/= msg "Function cancelled")
(princ (strcat "\nError: " msg))
)
(if oom
(setvar "osmode" oom)
)
(princ)
)
(setq pnt (getpoint "\npick point: "))
(setq hdist (getdist pnt "\nget the distance of horizontal: "))
(setq vdist (getdist pnt "\nget the distance of vertical: "))
(setq ang (angle pnt pnt))
(setq a (polar pnt 0.0 hdist))
(setq b (polar pnt (- (* pi 0.5)) vdist))
(setq c (polar b 0.0 hdist))
(setq d (polar c (* pi 0.5) vdist))
(setq p3 (polar pnt (angle pnt a) (/ (distance pnt a)2)))
(setq int (getint "\nenter of lines: "))
(setq i 0)
(command "line" pnt a "")
(command "line" pnt b c d "")
(command "text" p3 0.2 "0" "thajmul" "")
(command "move" p3 "" "d" "@0,-0.2,0" "")
(repeat int
(command "line" pnt a "")
(command "copy" (entlast) "" pnt (polar pnt (dtr 270)0.2))
(setq pnt (polar pnt (dtr 270)0.2))
(setq a (polar a (dtr 270.0)0.2))
(setq i (+ 1 i))
(command "overkill" (setq pnt (ssget "c" '(2,2,0) '(2,2,0)) '(0 . "line")) "")
)
(princ)
)