RobDraw Posted August 14, 2012 Posted August 14, 2012 I missed that last enter. Got grips now. Let's hope that's what the OP needed also. Note: it does not work in 2002. Quote
irneb Posted August 14, 2012 Posted August 14, 2012 If the Select command doesn't do it for you, you could always try the older PSelect command (note also not QSelect). Take note that Lee's PtManager uses ssget in some instances, this might clear the previous selection set - so you might thus loose the selection. If you want a "permanent" selection, you could do something like this: (setq mySelection (ssget)) Either type that into the command prompt after you've grip-selected (say using QSelect) or type it in and then select. Now the mySelection lisp variable holds that selection until you close the drawing. So you can issue something like this to re-grip-select it: (sssetfirst nil mySelection) Or if something (other than a lisp program) is asking you to select something, simply type this (command mySelection) Actually, this is one of the reasons I prefer using the Filter command instead of QSelect. It remembers the last filter settings you used, and you can save these settings to a name which you can recall next year in another DWG if you so wish. Quote
toberino Posted August 14, 2012 Author Posted August 14, 2012 SLW210 said: After Select>Previous hit enter, then hit enter again......Get A Grip Below is a screenshot of three blocks individually selected with the grips showing.... Below is a screenshot with the select command invoked and the previous option selected... And then with that last enter which just ends the select command... Quote
toberino Posted August 14, 2012 Author Posted August 14, 2012 SLW210 said: Try it with _PICKADD=2. My pickadd choices are 1 or 0. It will not accept a 2. Quote
SLW210 Posted August 14, 2012 Posted August 14, 2012 Must be available in 2011 and newer only. Sorry, sounds like upgrade time. You could try the 30 day trial of 2013. Quote
toberino Posted August 14, 2012 Author Posted August 14, 2012 SLW210 said: Must be available in 2011 and newer only. Sorry, sounds like upgrade time. You could try the 30 day trial of 2013. Not my choice. I work for a very large company. I must adapt to the tools provided. I am not giving up yet though. I know there is a solution. Quote
irneb Posted August 14, 2012 Posted August 14, 2012 Have you tried my suggestions in post #22? E.g. the PSelect was something which worked like the Select does now when PickAdd=2. But I think you may run into the situation as I've described later, seeing as Lee's code "could" issue a ssget which would clear any previous selection - so none of these would do what you want. If this is the case, then try one of my other suggestions: (1) use Filter instead of QSelect (makes reusing the same filter selection a 2 click process instead of multiple clicks and typing as QSelect does); or (2) save a selection set into a lisp variable so you can reuse it whenever, no matter what's happened to any sort of previous selection (add the code to a button in your CUI if you don't want to type it out / copy-paste it each time). Quote
irneb Posted August 14, 2012 Posted August 14, 2012 (edited) As an example. Here's what I mean by the filter command: Or going with the lisp variable idea: Edited August 14, 2012 by irneb Wrong image for the lisp variable, sorry Quote
toberino Posted August 14, 2012 Author Posted August 14, 2012 irneb said: Have you tried my suggestions in post #22? E.g. the PSelect was something which worked like the Select does now when PickAdd=2. But I think you may run into the situation as I've described later, seeing as Lee's code "could" issue a ssget which would clear any previous selection - so none of these would do what you want. If this is the case, then try one of my other suggestions: (1) use Filter instead of QSelect (makes reusing the same filter selection a 2 click process instead of multiple clicks and typing as QSelect does); or (2) save a selection set into a lisp variable so you can reuse it whenever, no matter what's happened to any sort of previous selection (add the code to a button in your CUI if you don't want to type it out / copy-paste it each time). I am going to work with filter for a little bit. It is a more pwerful qselect and is transparent, which is a good feature. I just need to find a way to turn on the grips within the previous option in a command. I think it is getting the selection set properly, its just not giving me the visual that I want. Quote
irneb Posted August 14, 2012 Posted August 14, 2012 You might also need to adjust your GripObjLimit. If you've selected more objects than this limit the grips won't show. Quote
toberino Posted August 14, 2012 Author Posted August 14, 2012 irneb said: You might also need to adjust your GripObjLimit. If you've selected more objects than this limit the grips won't show. I've got that one turned up to 5000. Quote
toberino Posted August 17, 2012 Author Posted August 17, 2012 Would it be possible for an admin to move this post to the AutoLISP section and change the title to "Select the same entities again...AutoLISP routine" or something like that. I don't think I am getting the exposure for all possibilities over here. Thanks. Quote
toberino Posted August 17, 2012 Author Posted August 17, 2012 SLW210 said: Moved as requested.................. Thank you. Hopefully someone that has already found a solution for this type of situation will see this thread and post a reply. Quote
irneb Posted August 18, 2012 Posted August 18, 2012 Try this (haven't tested it at all) (defun c:SaveSelection (/ ss n en name enames) (if (and (or (setq ss (cadr (ssgetfirst))) (setq ss (ssget))) (or (setq name (getstring (strcat "\nEnter a name for this selction <Selection_" (itoa (length *SavedSelections*)) ">: "))) (setq name (strcat "Selection_" (itoa (length *SavedSelections*)))))) (progn (repeat (setq n (sslength ss)) (setq enames (cons (ssname ss (setq n (1- n))) enames))) (setq name (strcase (vl-string-translate " _" "--" name))) (if (setq ss (assoc name *SavedSelections*)) (setq *SavedSelections* (subst (cons name enames) ss *SavedSelections*)) (setq *SavedSelections* (cons (cons name enames) *SavedSelections*))) (princ (strcat "\nSelection " name " saved with " (itoa (length enames)) " items selected."))) (princ "\nNo selection saved.")) (princ)) (defun c:ReSelect (/ name enames ss) (if *SavedSelections* (if (or (setq name (progn (initget (vl-string-trim " " (apply 'strcat (mapcar '(lambda (sel) (strcat " " (car sel))) *SavedSelections*)))) (getkword (strcat "Which selection [" (vl-string-trim "/" (apply 'strcat (mapcar '(lambda (sel) (strcat "/" (car sel))) *SavedSelections*))) "] <" (caar *SavedSelections*) ">: ")))) (setq name (caar *SavedSelections*))) (if (setq enames (cdr (assoc name *SavedSelections*))) (progn (setq ss (ssadd)) (foreach e enames (ssadd e ss)) (if (> (getvar "CMDACTIVE") 0) (command ss) (sssetfirst nil ss))) (princ (strcat "\nSelection " name " could not be found in the saved selections list.")))) (princ "\nNo selection saved.")) (princ)) It gives 2 commands: SaveSelection: Saves the current selection (or a new one if nothing is currently selected) to a name you specify. ReSelect: Asks for a name and reselects the items which was saved to that name (enter means the last saved one). This command can be run transparently by prefixing a ' (quote) to it. I'd add these 2 as toolbar buttons / keyboard shortcuts in the cui so its easier to make use of them. Just use SaveSelection sparingly as it keeps the list of selections throughout the dwg's session - i.e. it can grow extremely long. Quote
ketxu Posted August 19, 2012 Posted August 19, 2012 @irneb: Thank you for idea.its funny. But I think it's not ok with keyword func. Enter not mean last saved one and getstring should be T arg? Quote
irneb Posted August 19, 2012 Posted August 19, 2012 Thanks, I suppose I could add the T to getstring - so the name could include spaces. I already account for that by using vl-string-translate to convert those to "-". That's so the keywords work correctly, keywords can't have spaces or underscores. Quote
sachindkini Posted August 20, 2012 Posted August 20, 2012 irneb said: Try this (haven't tested it at all)(defun c:SaveSelection (/ ss n en name enames) (if (and (or (setq ss (cadr (ssgetfirst))) (setq ss (ssget))) (or (setq name (getstring (strcat "\nEnter a name for this selction <Selection_" (itoa (length *SavedSelections*)) ">: "))) (setq name (strcat "Selection_" (itoa (length *SavedSelections*)))))) (progn (repeat (setq n (sslength ss)) (setq enames (cons (ssname ss (setq n (1- n))) enames))) (setq name (strcase (vl-string-translate " _" "--" name))) (if (setq ss (assoc name *SavedSelections*)) (setq *SavedSelections* (subst (cons name enames) ss *SavedSelections*)) (setq *SavedSelections* (cons (cons name enames) *SavedSelections*))) (princ (strcat "\nSelection " name " saved with " (itoa (length enames)) " items selected."))) (princ "\nNo selection saved.")) (princ)) (defun c:ReSelect (/ name enames ss) (if *SavedSelections* (if (or (setq name (progn (initget (vl-string-trim " " (apply 'strcat (mapcar '(lambda (sel) (strcat " " (car sel))) *SavedSelections*)))) (getkword (strcat "Which selection [" (vl-string-trim "/" (apply 'strcat (mapcar '(lambda (sel) (strcat "/" (car sel))) *SavedSelections*))) "] <" (caar *SavedSelections*) ">: ")))) (setq name (caar *SavedSelections*))) (if (setq enames (cdr (assoc name *SavedSelections*))) (progn (setq ss (ssadd)) (foreach e enames (ssadd e ss)) (if (> (getvar "CMDACTIVE") 0) (command ss) (sssetfirst nil ss))) (princ (strcat "\nSelection " name " could not be found in the saved selections list.")))) (princ "\nNo selection saved.")) (princ)) It gives 2 commands: SaveSelection: Saves the current selection (or a new one if nothing is currently selected) to a name you specify. ReSelect: Asks for a name and reselects the items which was saved to that name (enter means the last saved one). This command can be run transparently by prefixing a ' (quote) to it. I'd add these 2 as toolbar buttons / keyboard shortcuts in the cui so its easier to make use of them. Just use SaveSelection sparingly as it keeps the list of selections throughout the dwg's session - i.e. it can grow extremely long. Dear Sir, Very Very Nice Lisp thx for sharing, q1) can this i use existing command (example c:copy Select objects: existing selection save name xyz) q2) can u add dcl for better selection Quote
irneb Posted August 20, 2012 Posted August 20, 2012 Yes you can! Q1: Consider this: Command: COPY Select objects: Specify opposite corner: 4 found Select objects: Current settings: Copy mode = Multiple Specify base point or [Displacement/mOde] <Displacement>: Specify second point or [Array] <use first point as displacement>: Specify second point or [Array/Exit/Undo] <Exit>: *Cancel* Command: SAVESELECTION Select objects: p 4 found Select objects: Enter a name for this selction <Selection_0>: Selection SELECTION-0 saved with 4 items selected. Command:MOVE Select objects: Specify opposite corner: 8 found Select objects: Specify base point or [Displacement] <Displacement>: Specify second point or <use first point as displacement>: Command: SAVESELECTION Select objects: p 8 found Select objects: Enter a name for this selction <Selection_1>: Selection SELECTION-1 saved with 8 items selected. Command: MOVE Select objects: 'reselect Which selection [sELECTION-1/SELECTION-0] <SELECTION-1>: 8 found Select objects: Select objects: Specify base point or [Displacement] <Displacement>: Specify second point or <use first point as displacement>: Q2: Can you speak to my boss to give me some more spare time for this? I'd like to do it, just have to do my day-job for now. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.