Ramana Posted November 18, 2008 Posted November 18, 2008 Hello Friends, Greetings, through lisp how to find the number of objects of a BLOCK and how to change its general properties. for example:- I have few circles in a block, which i would like to change its color, and few other objects thinckness. thanks & Regards Ramana Quote
ReMark Posted November 18, 2008 Posted November 18, 2008 What version are you currently using? There should be a block counter in Express Tools called, strangely enough, BCount. It's a lisp program. Quote
ASMI Posted November 18, 2008 Posted November 18, 2008 Short example in Visual LISP Console window: Load Visual LISP extension: _$(vl-load-com) Get object of an Active Document: _$ (setq actDoc(vla-get-ActiveDocument(vlax-get-acad-object))) #<VLA-OBJECT IAcadDocument 01ff6950> Get Blocks Collection: _$ (setq blCol(vla-get-Blocks actDoc)) #<VLA-OBJECT IAcadBlocks 0e57d01c> Get object of block with name "block1": _$ (setq cBl(vla-Item blCol "block1")) #<VLA-OBJECT IAcadBlock2 0e57d47c> Retrieve number of entities of block: _$ (vla-get-Count cBl) 4 Paint all circles in Red color (1): _$ (vlax-for e cBl (if(= "AcDbCircle"(vla-get-ObjectName e))(vla-put-Color e 1))) nil Regenerate document to see change of color in block references: _$ (vla-regen actDoc 1) Regenerating model. Quote
Ramana Posted November 19, 2008 Author Posted November 19, 2008 thanks friends, I have not checked in express tools, I will go through it. thanks again for vlisp codes. Ramana Quote
Recommended Posts
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.