CAD Forums > CAD General

block isolate

(1/5) > >>

ELOQUINTET:
hey guys i am wondering if someone has a way to isolate a given block globally similar to the layer isolate function from express tools but through a dialogue box so i don't have to find the block. or if there's a way to do this with just plain acad let me know. thanks

dan

Mark:
you could use Quick Select to isolate them.

hendie:
or.. quick 'n'dirty with no error checking

--- Code: ---(DEFUN C:ISOBLK (/ BBLK BLK BLKNAME CNT N)
  (setq Blkname (getstring "\nPlease enter blockname to isolate: "))
  (setq Blk
(ssget "X"
(list
 (cons -4 "<NOT")
 (cons 2 Blkname)
 (cons -4 "NOT>")
)
)
  )
  (setq Cnt (sslength blk))
  (setq n 0)
  (while (< n Cnt)
    (setq Bblk (vlax-ename->vla-object (ssname blk n)))
    (vlax-put-property Bblk 'visible 0)
    (setq n (1+ n))
  )
  (setq Blk NIL)
  (princ)
)

(DEFUN C:SEEALL (/ ALL CNT N NALL)
  (setq All (ssget "X"))
  (setq Cnt (sslength All))
  (setq n 0)
  (while (< n Cnt)
    (setq Nall (vlax-ename->vla-object (ssname All n)))
    (vlax-put-property Nall 'visible 1)
    (setq n (1+ n))
  )
  (setq All NIL)
  (princ)
)
--- End code ---


am I doing anything here which is likely to blow up in my (or someone else's) face later ?

daron:
That looks great Hendie. One way to avoid errors would be to access the block table - the model and paper space blocks and return them in a form or dcl if you like to torture yourself. Trev re-wrote the express tool global attribute editor in vba for me that we might be able to grab the block access funtion and re-work it to do what is asked here or what you show in lisp.

ELOQUINTET:
hendie it sort of works. if the block name has no spaces it works fine but when you hit the spacebar it executes the command turning everything off. good work though it's almost there.

dan

Navigation

[0] Message Index

[#] Next page

Go to full version