Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ssget an entity name?

0 views
Skip to first unread message

Jason Piercey

unread,
Jan 22, 2002, 8:56:16 PM1/22/02
to
Is this not allowed? doesn't seem to work for me.

(setq ss (ssget "X" (list (cons -1 Ename))))

I didn't see anything in the help files on this restriction.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program

Paul Turvill

unread,
Jan 22, 2002, 10:16:38 PM1/22/02
to
Why would you ever need to? If you already have the Ename, you can
manipulate the object directly; and if you need the entity list, you can use
(entget Ename).

If you *really* want a selection set consisting of Ename, just use
(setq ss (ssadd Ename)).
___

"Jason Piercey" <discussio...@autodesk.com> wrote in message
news:4EC66B79F428C84C...@in.WebX.maYIadrTaRb...

Jason Piercey

unread,
Jan 22, 2002, 11:08:32 PM1/22/02
to
I figured that "Why?" would be the first question. I am writing some of my
own functions to handle/read LwPolyLines values and was thinking (that
usually leads to trouble) that something like (GetSeg) would nice to have
but without the need for user selection. I thought I could calculate
'Point' value by using (grread T) and create the ss with the entity name to
pass to (ssnamex) but that doesn't eliminate the user input (crosshair
location would become important, not thinking clearly), so then I was
thinking step through the 10's and to calculate 'Point' but by the time I
stepped through those codes I already know what segment of the polyline I am
at and there is no need for (nth 2 ....). I can't believe I couldn't think
of (ssadd), time to call it a night.

So really just making it more complicated/senseless than need be.

(defun GetSeg ( Point )
(nth 2 (car (ssnamex (ssget Point) ) ) )
)

Alex Repetto

unread,
Jan 23, 2002, 4:19:52 AM1/23/02
to
Jason,

> (defun GetSeg ( Point )
> (nth 2 (car (ssnamex (ssget Point) ) ) )
> )

Perhaps this?


(defun GetSeg ( Point )

(nth 2 (car (ssnamex (ssget "F" (list (polar Point pi 0.001) (polar Point
0 0.001))) ) ) )
)

I tried the distance and it works until 0.000001 when Point is exactly on
top of the object.

Alex

Jason Piercey

unread,
Jan 23, 2002, 9:19:04 AM1/23/02
to
The idea was not to have to worry about user "selection". I was thinking
completely backwards, What I was trying to do had no end benefit. It looked
good at first, but after thinking logically there was no point in doing so.

If user selection is involved then just do this and forget about "F" with
(ssget)

(defun GetSeg ( Lst )
(nth 2 (car (ssnamex (ssget (cadr (entsel) ) ) ) ) )
)

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


"Alex Repetto" <arep...@huisman-itrec.com> wrote in message
news:DD32E8EFDA253436...@in.WebX.maYIadrTaRb...

Alex Repetto

unread,
Jan 23, 2002, 11:02:14 AM1/23/02
to
Jason,

> The idea was not to have to worry about user "selection". I was thinking
> completely backwards, What I was trying to do had no end benefit. It looked
> good at first, but after thinking logically there was no point in doing so.

Ok

> If user selection is involved then just do this and forget about "F" with
> (ssget)
>
> (defun GetSeg ( Lst )
> (nth 2 (car (ssnamex (ssget (cadr (entsel) ) ) ) ) )
> )

Off course but the trick is that using:


(ssget "F" (list (polar Point pi 0.001) (polar Point 0 0.001))) ) ) )

you create a selection set by dragging the crosshairs over the screen:

(defun C:DynamicSelect ( / PrevPoint Point sel )
(while 1
(setq Point (cadr (grread 1)))
(if (not PrevPoint)
(setq PrevPoint Point)
)
(setq sel (ssget "F" (list PrevPoint Point)))
(setq PrevPoint Point)
(if sel
(redraw (ssname sel 0) 3)
)
)
(princ)
)

Alex

0 new messages