Arizona Posted January 29, 2010 Posted January 29, 2010 Can anyone show me the code for a Selection Set from a user picked Window Poly? The help only shows me one that is defined from a preset batch of coords. I also need it to only get blocks with a specific name (2 . "name") Thanks. Quote
Lee Mac Posted January 29, 2010 Posted January 29, 2010 You can get at the information from a selection set using ssnamex Quote
Arizona Posted January 29, 2010 Author Posted January 29, 2010 Thanks Lee. Reaserched SSNAMEX and it's above my skill set. My lisp skills go back to R12.... I think I have it by doing this: (command "select" "WP") (setq ss1 (ssget "_P" '((2 . "P-MH")))) I was looking for something cleaner, but it works. Quote
Shawndoe Posted January 31, 2010 Posted January 31, 2010 Hi, Try this (setq SS1 (ssget "_WP" (while (/= (setq Pnt (getpoint "Pick a Point: \n")) nil) (setq Pnt_List (cons Pnt Pnt_List)) ) '((2 . "M-PH")) ) ) Have a good one. Shawn Quote
Lee Mac Posted January 31, 2010 Posted January 31, 2010 How about this? (defun GetWindowPoly (/ PtLst pt gr) ;; Lee Mac ~ 31.01.10 (if (car (setq ptLst (list (getpoint "\nSpecify First Point: ")))) (progn (princ "\nPick Window Points >>") (while (setq pt (progn (while (and (= 5 (car (setq gr (grread 't 5 0)))) (listp (cadr gr))) (redraw) (mapcar (function (lambda (from to) (grdraw from to 3 1))) (cons (cadr gr) ptLst) (append ptLst (cdr gr)))) (cond ((listp (cadr gr)) (cadr gr))))) (cond (pt (setq ptLst (cons pt ptLst))))) (redraw) (reverse ptLst)))) (defun c:test (/ pts ss) (if (and (setq pts (GetWindowPoly)) (setq ss (ssget "_WP" pts))) (sssetfirst nil ss)) (princ)) Pity about OSnap Quote
devitg Posted January 31, 2010 Posted January 31, 2010 Hi Lee , I learn a few time ago , that all SSGET , except "X" , need the points be shown at the screen. Guess I do a pan and zoom when pick for the last point , and the previous points are not show at the screen, the SSGET return NIL . In such case I do a ZOOM. Quote
Lee Mac Posted January 31, 2010 Posted January 31, 2010 Hi Lee , I learn a few time ago , that all SSGET , except "X" , need the points be shown at the screen.Guess I do a pan and zoom when pick for the last point , and the previous points are not show at the screen, the SSGET return NIL . In such case I do a ZOOM. Perhaps true, mine was just a example for windowing 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.