thekiki Posted January 10 Posted January 10 Hi, I'm looking for 3 lisp that can allow me to select only: lisp 1 - polyline by crossing window. lisp 2 - text by crossing window. lisp 3 - Blocks by crossing window. Thanks for your help. Quote
pkenewell Posted January 10 Posted January 10 @thekiki This is very simple. This could also be done very easily without AutoLISP with the FILTER command. (defun c:Selpline (/ p1) (ssget "C" (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (getcorner p1 "\nSelect 2nd point of crossing window: ") '((0 . "*POLYLINE"))) ) (defun c:Seltext (/ p1) (ssget "C" (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (getcorner p1 "\nSelect 2nd point of crossing window: ") '((0 . "*TEXT"))) ) (defun c:Selblock (/ p1) (ssget "C" (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (getcorner p1 "\nSelect 2nd point of crossing window: ") '((0 . "INSERT"))) ) Quote
Steven P Posted January 10 Posted January 10 So what I might do is look at the questions you asked before and refer to this: http://lee-mac.com/ssget.html to see if you can apply that. I'd reckon all you need to do is modify the word "TEXT" to whatever you want. If you want to find the text to use in the filter, use this: (cdr (assoc 0 (entget (car (entsel "Select Entity: "))))) Which will give the description of the entity type (for example "TEXT", "MTEXT", "LWPOLYLINE", "INSERT" or whatever it might be. Quote
thekiki Posted January 10 Author Posted January 10 Thanks for your reply. Pkenwell, I try your lisps, but I can't manage to select pline, or text? When i make crossing window, with your lisps, it doesn't work!! My purpose is when i select crossing window, i would like to select only pline or text or block... Quote
pkenewell Posted January 10 Posted January 10 @thekiki I tested these and they work fine for me. Have you tried doing the Move command and P for previous after? These do not highlight the selection set. Quote
thekiki Posted January 10 Author Posted January 10 I don't know that method, but it's work! Do you know how to highlight the selection without typing Move command and P.. Many thanks again! Quote
pkenewell Posted January 10 Posted January 10 (edited) @thekiki Try This version: (defun c:Selpline (/ p1 p2 ss) (if (and (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (setq p2 (getcorner p1 "\nSelect 2nd point of crossing window: ")) (setq ss (ssget "C" p1 p2 '((0 . "*POLYLINE")))) ) (sssetfirst nil ss) ) ss ) (defun c:Seltext (/ p1 p2 ss) (if (and (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (setq p2 (getcorner p1 "\nSelect 2nd point of crossing window: ")) (setq ss (ssget "C" p1 p2 '((0 . "*TEXT")))) ) (sssetfirst nil ss) ) ss ) (defun c:Selblock (/ p1 p2 ss) (if (and (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (setq p2 (getcorner p1 "\nSelect 2nd point of crossing window: ")) (setq ss (ssget "C" p1 p2 '((0 . "INSERT")))) ) (sssetfirst nil ss) ) ss ) Edited January 10 by pkenewell Edited to add some error prevention 3 Quote
pkenewell Posted January 10 Posted January 10 2 minutes ago, thekiki said: That's perfect!! Thanks again. @thekiki Your Welcome. I suggest you use these as examples to start learning how to do your own AutoLISP routines. 2 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.