entsel, fail, use fail-point for crossing/fence
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
entsel, fail, use fail-point for crossing/fence

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
GTASteve
Guest





Posted: Wed Jan 12, 2005 12:38 am    Post subject: entsel, fail, use fail-point for crossing/fence Reply with quote

Hello all,

I want the LISP, to do similar to say, the ERASE command.

e.g.
ERASE [Enter]
{pickbox shown on screen, user can select a single object}
{if user clicks an empty space, the crossing/window option is auto-invoked}

For my scenario, I want something similar...

(setq usrPick (entsel "\nSelect Object: "))
;if this fails, I want the 'fail-point', so that I can use this point to start a fence...
;I know it seems weird, but there is a good reason for this behaviour... ;-)

Cheers,
Steve

Back to top
T.Willey
Guest





Posted: Wed Jan 12, 2005 12:57 am    Post subject: Re: entsel, fail, use fail-point for crossing/fence Reply with quote

(setq Pt1 (cadr (grread 3)))

This should give you the point when entsel fails to select something.

Tim
Back to top
Jim Claypool
Guest





Posted: Wed Jan 12, 2005 1:30 am    Post subject: Re: entsel, fail, use fail-point for crossing/fence Reply with quote

Use (ssget ":S") instead. Just keep in mind that with a crossing window you
can select more than one object.


"GTASteve" <nospam@address.withheld> wrote in message
news:9575702.1105472326998.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
Hello all,

I want the LISP, to do similar to say, the ERASE command.

e.g.
ERASE [Enter]
{pickbox shown on screen, user can select a single object}
{if user clicks an empty space, the crossing/window option is
auto-invoked}

For my scenario, I want something similar...

(setq usrPick (entsel "\nSelect Object: "))
;if this fails, I want the 'fail-point', so that I can use this point to
start a fence...
;I know it seems weird, but there is a good reason for this behaviour...
;-)

Cheers,
Steve


Back to top
Jason Piercey
Guest





Posted: Wed Jan 12, 2005 1:37 am    Post subject: Re: entsel, fail, use fail-point for crossing/fence Reply with quote

Maybe this will help?


;Modified from Tanzillo's (SelectObjectOrWindow)
;Return: List, list returned by (entsel) or a list of two points
(defun SelectObjectOrPickPoints (msg / Res p2)
(if (not msg) (setq msg "\nSelect object/<first point>: "))
(setvar "errno" 0)
(if (setq Res (entsel msg))
Res
(if (and (eq 7 (getvar "errno"))
(setq Res (grread t))
(eq (car Res) 5)
(setq p2 (getpoint (cadr Res) "\nopposite corner: "))
)
(list (cadr Res) p2)
)
)
)


--
Autodesk Discussion Group Facilitator



"GTASteve" <nospam@address.withheld> wrote in message
news:9575702.1105472326998.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
Hello all,

I want the LISP, to do similar to say, the ERASE command.

e.g.
ERASE [Enter]
{pickbox shown on screen, user can select a single object}
{if user clicks an empty space, the crossing/window option is
auto-invoked}

For my scenario, I want something similar...

(setq usrPick (entsel "\nSelect Object: "))
;if this fails, I want the 'fail-point', so that I can use this point to
start a fence...
;I know it seems weird, but there is a good reason for this behaviour...
;-)

Cheers,
Steve
Back to top
Adesu
Guest





Posted: Wed Jan 12, 2005 8:30 am    Post subject: Re: entsel, fail, use fail-point for crossing/fence Reply with quote

Hi Steve,may be you can try my code

; eo is stand for erase object
; Design by Ade Suharna <mteybid@yuasabattery.co.id>
; 4 January 2005
; Program no.155/01/2005
; Edit by
(defun c:eo (/ ob ss)
(while
(setq ob (strcase (getstring T "\nENTER NAME OBJECT: ")))
(setq ss (ssget "x" (list (cons 0 ob))))
(command "_erase" ss "")
)
(princ)
)



GTASteve <nospam@address.withheld> wrote in message
news:9575702.1105472326998.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
Hello all,

I want the LISP, to do similar to say, the ERASE command.

e.g.
ERASE [Enter]
{pickbox shown on screen, user can select a single object}
{if user clicks an empty space, the crossing/window option is
auto-invoked}

For my scenario, I want something similar...

(setq usrPick (entsel "\nSelect Object: "))
;if this fails, I want the 'fail-point', so that I can use this point to
start a fence...
;I know it seems weird, but there is a good reason for this behaviour...
;-)

Cheers,
Steve
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB