Jump to content

Recommended Posts

Posted

Hello all long time lurker here but I don't post much.

 

I am trying to write a lisp that zooms to extents, selects all and then deselects everything within the extents.

 

I need to do this since I'm working on some dirty files with a bunch of hideen junk that I need to purge out.

 

I've got the lisp to zoom to extents and selecting all part down and I'm stuck on the deselecting everything in the extents of the drawing part.

 

Thanks in advance.:D

Posted

Not sure if I understand this:

 

Why not select the objects you don't want (ssget "CP", "WP") or something similar and then have the lisp select everything not in the sset?

 

Alternatively apply the above in reverse.

 

Although I can't understand why you'd select and then deselect everything. The result would be the same as doin' nothing (other than the zoom extents)

Posted

I guess the command Zoom extents does not require to select any object . !

 

You may mean Zoom -> Object ?

Posted

Would this work for you?

 

(defun c:test ( / s1 )
 (if (setq s1 (ssget "_X" (list (cons 410 (getvar 'CTAB)))))
   (command "_.select" s1 "_remove"
     (ssget "_W" (getvar 'EXTMIN) (getvar 'EXTMAX) (list (cons 410 (getvar 'CTAB)))) ""
   )
 )
)

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