• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

show and hide the blocks according to their name

  • Thread starter Thread starter nik600
  • Start date Start date

nik600

Guest
Hello everyone

I am trying to write a lisp function that allows me to show / hide a block based on its name.

This is the code I wrote:
Code:
(defun c:test_show ()
(setq selection)
(redraw selection 1)
(princ)

(defun c:test_hide ()
(setq selection)
(redraw selection 2)
(princ)
ma quando lo eseguo ottengo questo errore:
Code:
command: test_show
; error: type of wrong subject: lentityp <selection 3="" set:=""></selection>
from what I understood redraw takes an ename type parameter, which is probably not what is returned by ssget

so, how can I convert the result of ssget to an ename, or how can I get the ename of an object having its name?

Thank you.
 
in fact the program expected the ename and you propinated a selection set. . .
qeusta is the correct writing:

(defun c:test_show ()
(setq selection)
index -1
)
(repeat (sslength selection)
(redraw (ssname selection (setq index (1+ index) 1)
)
(princ)
)

(defun c:test_hide ()
(setq selection)
index -1
)
(repeat (sslength selection)
(redraw (ssname selection (setq index (1+ index) 2))
)
(princ)
)
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top