Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

wide polyline selection by passing a point to ssget

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
299 Views, 4 Replies

wide polyline selection by passing a point to ssget

I wrote a lisp for a client that selects a polyline under a point.
Sporadically, but more often then I'd like, the ssget statement doesn't find
the polyline. It has something to do with the fact that a wide polyline has
to be selected on the edge and osnaps return a point at the center of the
polyline segment. Has anyone found a way to definatively beat this little
glitch?
Any help would be hot.
John Burrill
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

...so... How is the Point selected in the first place?
___

"John Burrill" wrote in message
news:732563C4662F448B0305E81EE4CF0067@in.WebX.maYIadrTaRb...
> I wrote a lisp for a client that selects a polyline under a point.
> Sporadically, but more often then I'd like, the ssget statement doesn't
find
> the polyline. It has something to do with the fact that a wide polyline
has
> to be selected on the edge and osnaps return a point at the center of the
> polyline segment. Has anyone found a way to definatively beat this little
> glitch?
> Any help would be hot.
> John Burrill
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

its a basic getpoint call with a running object snap.
Here's the code in question:
(defun thing ()
;a bunch of stuff happens but here's the important part.
(setvar "osmode 512);turns on the nearest object snap
(setq pt1 (getpoint "\n Select text insertion point on segment"))
(setq entname (ping_list pt1 '("LWPOLYLINE" "POLYLINE" "ARC" "LINE") nil)) )
;more code
)

(defun ping_list (EPT type-X SILENT / FILTER-X SSET type-x ept note-x)
;takes a point and a list of object types and checks to see if one of those
object types is at that point
(IF (/= EPT NIL)(cond
((= TYPE-X NIL)(SETQ SSET (SSGET EPT))(PROGN
(setq filter-x (list (cons 0 TYPE-X)))
(setq sset (ssget EPT filter-x))
));PROGN/arg
((= (type type-x) 'LIST)(progn
(setq filter-x (mapcar '(lambda
(x)
(cons 0
x));lambda
type-x))
(setq filter-x (append '((-4 .
" (setq filter-x (append filter-x
'((-4 . "OR>")) ))
(setq sset (ssget EPT filter-x))
));progn/arg

));cond/IF
(if (= SSET nil)(progn
(COND ((/= TYPE-X NIL)
(setq note-x (strcat "\n selection did not return entity;
reselect:\n")));ARG
(progn
(SETQ NOTE-X "\n SELECTION DID NOT RETURN ENTITY; RESELECT:\n")
(setq flag "ooger")));progn/cond
(IF (NOT SILENT)(prompt note-x));IF
);progn
(ssname sset 0));IF
);close function

-J
"Paul Turvill" wrote in message
news:8BF5330B84B925FFA8F1B4A9D18A2EB2@in.WebX.maYIadrTaRb...
> ...so... How is the Point selected in the first place?
> ___
>
> "John Burrill" wrote in message
> news:732563C4662F448B0305E81EE4CF0067@in.WebX.maYIadrTaRb...
> > I wrote a lisp for a client that selects a polyline under a point.
> > Sporadically, but more often then I'd like, the ssget statement doesn't
> find
> > the polyline. It has something to do with the fact that a wide polyline
> has
> > to be selected on the edge and osnaps return a point at the center of
the
> > polyline segment. Has anyone found a way to definatively beat this
little
> > glitch?
> > Any help would be hot.
> > John Burrill
> >
> >
>
>
Message 4 of 5
mataeux
in reply to: Anonymous

(setq pt1 (getpoint "\n Select text insertion point on segment") object_point(cadr(grread T )))
(setq entname (ping_list object_point '("LWPOLYLINE" "POLYLINE" "ARC" "LINE") nil)) )

or (setq pt1 .. without osmode=0
pass pt1 to ping_list and then later use (osnap pt1 "NEA") instead of pt1
Message 5 of 5
Anonymous
in reply to: Anonymous

That is absolutely trick, man, thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost