Block count in a table

Block count in a table

Anonymous
Not applicable
798 Views
1 Reply
Message 1 of 2

Block count in a table

Anonymous
Not applicable

Hello everyone, I have a toto.lsp lisp that I would like to modify so that it takes into account the color of the different layers of the blocks in the generated table. The blocks are in layer color. I have found information but I can't seem to do this new functionality. Thank you for giving me leads. Best regards.

0 Likes
799 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Hello,
I would like to know what is the function to change the color of a block in an Autocad table cell. Here is a function I found : 

 

 

(defun c:tata(/ doc ent sel)
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-startundomark doc)
  (and (ssget "x" (list (cons 0 "insert")))
    (vlax-for ent (setq sel (vla-get-activeselectionset doc))
      (vla-put-color ent (vla-get-color (vla-item (vla-get-layers doc) (vla-get-layer ent))))
    )
    (vla-delete sel)
  )
  (vla-endundomark doc)
  (princ)
)

 


Is this a good solution ?
Best regards.

0 Likes