Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted
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 :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...