Jump to content

Recommended Posts

Posted

I'm trying to find the smoothest way of using (ssget "wp" ptlist)

 

I want it to be as similar to (command "select" "wp") as possible. (perhaps its possible to extract a ptlist from select wp?)

 

Which is the best way? draw a polyline?

Posted
 
;;;**************** example 1***********
(setq ptlst '())
(setq pts 1)
(while pts
(setq pts(getpoint "\nSelect Point: "))
(if pts (setq ptlst (cons pts ptlst)))
);_while
(if pts (setq ss(ssget "_WP" ptlst)))
;;;***********example 2
(command "select" "WP")
(setq ss (ssget "_P"))

Posted

John, you can make it a little more concise:

 

(while (setq pt (getpoint pt "\nSpecify a point:"))
 (setq ptlst (cons pt ptlst))
)
(if ptlst
 (setq ss (ssget "_WP" ptlst))
)

 

another way more "graphical"

 

(defun c:sswp (/ pt ptlst ss)
 (if (setq pt (getpoint "\nSpecify a point:"))
   (progn
     (setq ptlst (list pt))
     (while (setq pt (getpoint pt "\nSpecify a point:"))
       (redraw)
       (setq ptlst (cons pt ptlst))
       (grvecs (apply 'append (mapcar 'list ptlst (cdr ptlst))))
     )
     (setq ss (ssget "_WP" ptlst))
     (redraw)
     (sssetfirst nil ss)
   )
 )
 (princ)
)

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...