Jump to content

How to select all objects enclosed in a poly line


mrmanagerr

Recommended Posts

(setq x ptlst)
(setq lst(mapcar '(lambda ( x ) (read (strcat "(" (vl-string-translate "," " " x) ")"))) lst))
(princ lst)
 (setq ss4 (ssget "_WP" lst (list (cons 0 "*Text"))))
(setq i (1 - i))
(setq en (ssname ss2 (setq k (1 + k))))
(setq ent (entget en))

I used above code and i got below results.

 

("426982.418,511619.699" "426974.535,511603.142" "426964.041,511609.123" "426954.742,511612.095" "426946.029,511615.082" "426950.240,511625.283" "426955.404,511635.795" "426959.956,511644.578" "426970.869,511642.286" "426979.196,511640.264" "426985.400,511638.352" "426990.116,511635.794") 
nil nil
nil 
; error: too many arguments
_$ 

 

Still my problem not solved. thank you for helping me.  I am waiting for your answer.

Link to comment
Share on other sites

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • BIGAL

    4

  • Dhammike

    4

  • Jack_O'neill

    2

  • mrmanagerr

    2

Top Posters In This Topic

Posted Images

(setq ss4 (ssget "_WP" PTLST1 '((8 . "TEXT-PN")) ) I -1)
(SETQ SSLEN(SSLENGTH SS4))
(setq en (ssname ss4 (setq i (1+ i))))
(setq ent (entget en))

i used above code and got answer.  Thank you very much. But "_WP"  select objects completely inside the polygon.  if part of text out side the polygon will not select. (eg. 203, 206 numbers). How can i select all text withn polygon,  if insertion point of the text is within the polygon.

 

polygon2.JPG

Link to comment
Share on other sites

  • 2 years later...

Hello!

 

I know this is an old topic but I've got a problem I'm trying to solve. the action I'm trying to perform is generally the same as the OP's question. I have a polygonal PLINE and I want to select only the sections of PLINEs and other objects that are within that polygon. I've tried using Alan's original LISP from earlier in this thread and did a bunch of research on how to execute LISPs, but I can't seem to get it to work for me. I figured maybe it's not working because the software has changed so much since that code was originally written, but I don't know enough about LISPs to be able to fix it myself. It may also be that it's not broken and I just don't know what I'm doing (I'm very new to AutoCAD, I use it for work and we just transitioned to it recently), but any help would be appreciated.

 

Thanks in advance!

Link to comment
Share on other sites

  • 7 months later...
On 3/31/2011 at 8:04 PM, alanjt said:

Here's one that will do both,...

Hi Alan, thanks for this.

 

I get this error. "; error: AutoCAD.Application: Not applicable" when choosing the crossing method. Tried to find the issue but couldn't.

Link to comment
Share on other sites

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