title image


Smiley NOSHOW.lsp anbei
;********************** Commands ******************************

; Emulating NOSHOW-function from CATIA

; (C) Any.Body 2004



; Nsh switches selected Entities to Noshow



(defun C:nsh ( / a)



(princ "\nFor Noshow")

(setq a (ssget)) ; select visible

(if a

(noshow a) ; put to noshow

(princ "\nNo Entities selected\n")

)

(princ)

)







; ssh switches selected entities to show

; Attention: after grclear, even entities already visible on screen

; can be selected !



(defun C:ssh ( / a b)

(setq

a (ssget "X" (list (cons 60 1))) ; get all noshowed from database

)

(if a

(progn

(grclear) ; clear all shown

(princ) ; required for R13c3

; to be performed before

; the next function



(show a) ; show all from noshow

(princ "\nFor Show")

(setq b (ssget)) ; select

(if b ; if some selected

(progn

(noshow (sssub a b)) ; noshow previous noshow minus picked again

(show b ) ; and show selected

)

(noshow a) ; if no selected all into noshow

)

)

(princ "\nNo Entities in NOSHOW\n")

)

(redraw) ; restore screen

(princ)

)







; fnsh finds all entities which are in noshow



(defun C:fnsh ( / a b)



(setq

a (ssget "X" (list (cons 60 1))) ; get all invisible

)

(if a ; if some count them

(progn

(setq b (sslength a))

(princ "\n") (princ b) (princ " Entities switched to Noshow\n")

)

(princ "\nNo Entities in Noshow\n")

)

(princ)

)





; Tnsh toggles all noshow entities to show



(defun C:tnsh ( / a)



(setq

a (ssget "X" (list (cons 60 1))) ; get all invisible

)

(if a ; if found

(show a) ; show them

(princ "\nNo Entities in NOSHOW\n")

)

(princ)

)



;********************** End Commands **************************



;********************** Functions ****************************



; sssub subtracts from selectionset a entities in selectionset b



(defun sssub (a b / c d e)

(setq d 0.0)

(while (setq e (ssname b d))

(if (ssmemb e a)

(setq a (ssdel e a))

)

(setq d (1+ d))

)

a

)





; noshow switches entities in pickset to "noshow"



(defun noshow ( a / b c d e)

(setq

b (sslength a)

c 0.0

)

(while (setq d (ssname a c))

(setq

e (entget d)



; The first time the sequence in a list is important:

; e (append (list (cons 60 1)) e) will only work with R12 entities



e (append e (list (cons 60 1)))

)

(entmod e)

(setq c (1+ c))

) ; ende while

)



; enoshow puts one entity to noshow



(defun enoshow ( a / e)

(setq

e (entget a)

e (append e (list (cons 60 1)))

)

(entmod e)

)





; show switches entities in pickset to "show"



(defun show ( a / b c d e)

(setq

b (sslength a)

c 0.0

)

(while (setq d (ssname a c))

(setq

e (entget d)

e (subst (cons 60 0) (assoc 60 e) e )

)

(entmod e)

(setq c (1+ c))

) ; ende while

)





; fld returns sublist assoc to a from list b



(defun fld (a b)

(cdr(assoc a b))

)



;********************** End Functions ************************





(princ)


Hilft's !?

Any - Auf gute Fragen ... folgen bessere Antworten --




geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: