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

ssget with custom prompt

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
4574 Views, 9 Replies

ssget with custom prompt

Lately I was talking to friend of mine, an AutoCAD programmer with lisp and
VBA, and he complained in some extend about ssget lisp function that did not
have an argument for programmers custom prompt input. I did one for me later
and I shared it with my friend. I'm sharing the same code with you guys too.
You may find it useful. I implement/mimic the ssget behavior as match as I
needed for my program; single and/or multiple add and remove options are
provided. The attached zip file contains the source and a compiled fas file
that you can incorporate to your fas/lisp/vlx libraries. The test/sample
file has detail information how to use it.

Thanks,
9 REPLIES 9
Message 2 of 10
pnorman
in reply to: Anonymous

This is just a question. Not a criticism!
I don't see the advantage over just doing:
(princ "Select objects to be changed...\n")
(setq SS1 (ssget))

And your function wouldn't let me right click to finish selecting?

Regards
Phill
Message 3 of 10
Tom Smith
in reply to: Anonymous

I agree with Phil. Seems like as admirable effort, but not something I've had occasion to care about. I just do an initial (prompt) then accept the standard selection prompt,
Message 4 of 10
Luis Esquivel
in reply to: Anonymous

It can be done using something like:

[code]
(prompt "Your prompt goes here: ")
(setvar "nomutt" 1)
(setq ss (ssget)) ;; your selection set setup goes here
(setvar "nomutt" 0)
[/code]

Make sure to have "nomutt" part of an error handler
Message 5 of 10
Tom Smith
in reply to: Anonymous

>"nomutt" part of an error handler

And be sure the eror handler is totally bulletprooof! People go crazy when their Command prompt disappears 🙂
Message 6 of 10
Anonymous
in reply to: Anonymous

Tom

Nice post!

































Regards Gary
My Mutts name is B.J.
Message 7 of 10
Anonymous
in reply to: Anonymous

Tom,

>"nomutt" part of an error handler

Also considering the dog policy at Adesk H.Q I think this is a bit cruel!
Regards Gary
www.drcauto.com
Message 8 of 10
Anonymous
in reply to: Anonymous

I didn't know this????
(princ "Select objects to be changed...\n")
(setq SS1 (ssget))
cooooooollllllllllll



"quiz" wrote in message
news:5268332@discussion.autodesk.com...
Lately I was talking to friend of mine, an AutoCAD programmer with lisp and
VBA, and he complained in some extend about ssget lisp function that did not
have an argument for programmers custom prompt input. I did one for me later
and I shared it with my friend. I'm sharing the same code with you guys too
You may find it useful. I implement/mimic the ssget behavior as match as I
needed for my program; single and/or multiple add and remove options are
provided. The at
tached zip file contains the source and a compiled fas file
that you can incorporate to your fas/lisp/vlx libraries. The test/sample
file has detail information how to use it.

Thanks,
Message 9 of 10
Anonymous
in reply to: Anonymous

; Marc'Antonio Alessi, Italy
; http://xoomer.virgilio.it/alessi
;
; Function: ALE_SsGetFilter
;
; Version 1.00 - 22/02/2005
; Version 1.01 - 04/03/2006 - added (setvar "ERRNO" 0)
;
; Description:
; Ssget with filter list
;
; Arguments:
; PrmStr = User prompt [STR]
; FltLst = ssget filter list

    ;
    ; Example:
    ; (ALE_SsGetFilter "Select attibuted block(s)" '((0 . "INSERT") (66 . 1)))
    ;
    ; Return Values:
    ; [PICKSET] Selection set
    ; nil if user press 'Return' or 'Space'
    ;
    (defun ALE_SsGetFilter (PrmStr FltLst / FlgSlt SelSet)
    (setvar "ERRNO" 0)
    (princ "\n_ ")
    (prompt (setq PrmStr (strcat "\n" PrmStr ": ")))
    (if
    (while (not FlgSlt)
    (if (setq SelSet (ssget FltLst))
    (not (setq FlgSlt T))
    (if (= 52 (getvar "ERRNO"))
    (setq FlgSlt T)
    (prompt (strcat "\nNo objects selected or valid, try again!"
    PrmStr))
    )
    )
    )
    (not (princ "\nFunction cancelled. "))
    SelSet
    )
    )
Message 10 of 10
ranjith0326
in reply to: Luis Esquivel

good solution

Regards,

R.Ranjith

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

Post to forums  

Autodesk Design & Make Report

”Boost