Jump to content

Recommended Posts

Posted

I was planning on writing a LISP that can unisolate objects that are currently hidden. So basically the hidden objects are temporarily shown to allow the selection of objects to unhide and then hide the objects again.

 

Probably have to run an ssget on all current objects and compare that to the hidden objects along with the selection to unhide in order to get this to work or is there a method to get the hidden o

Posted

Select All with : (setq ss (ssget "_X"))

Iterate through sel.set...

- if object is hidden it has (60 . 1) in (entget) DXF code list

- if object is visible (not hidden) it don't have (assoc 60 (entget ent)), or it has (60 . 0)

 

Regards, M.R.

  • Like 2
Posted

I think it's code 67 @marko_ribar

 

This should get all hidden items .. also paperspace viewports too.

(ssget "_X" '((67 . 1)))

 

  • Like 2
  • 3 weeks later...
Posted (edited)

@ronjonp, I found that code 60 works with this scenario. It also seems to get the same results as yours. Code 67 didn't work with this below. Had me scratching my head a little.

 

;;---------------------------------------------------------------------------
;; Hides all survey stuff, except for Survey lines, polylines and circles
;; Hides contour lines regardless
;; Written 2023.07.01 by 3dwannab
;;---------------------------------------------------------------------------
(defun C:OO_TS_Lines_Circles_Only (/ ss1 laynames) 

  (setq laynames "TS*")

  (setq ss1 (ssget "_X" 
                   '((-4 . "<or")

                     (-4 . "<and")
                     (8 . "contour")
                     (60 . 0) ;; 0 Object not Hidden, 1 Object Hidden
                     (-4 . "and>")

                     (-4 . "<and")
                     (0 . "~CIRCLE")
                     (0 . "~LINE")
                     (8 . "TS_*")
                     (60 . 0) ;; 0 Object not Hidden, 1 Object Hidden
                     (-4 . "and>")

                     (-4 . "or>")
                    )
            )
  )

  (if ss1 
    (progn 
      (command "._hideobjects" ss1 "")
      (prompt (strcat "\nHidden " (itoa (sslength ss1)) " object(s). All " laynames " layers except keeping Survey lines, polylines and circles"))
    )
    (prompt (strcat "\nNo objects found in layers " laynames " or lines and circles to keep..."))
  )
  (princ)
)
(princ)
(C:OO_TS_Lines_Circles_Only) ;; Only uncomment for testing

 

Edited by 3dwannab
Posted

An old lisp of 2004.

Two command: e_on e_off

Isn't the same that the new command : ISOLATEOBJECT

 

E_off-E_on.lsp

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