Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help Count Table - dinamic blocs with atribute

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
mihai_bantas
936 Views, 7 Replies

Help Count Table - dinamic blocs with atribute

Hi all,
I have a problem with an older lisp code found on the internet and modified by me...the code makes a table with the number of blocks selected in the drawing ... and it works perfectly.


The problem occurs in blocks with an attribute ... because it no longer displays the real name of the block and in the table the figure is inserted without attribute values.

 

My request is that someone can help me modify this code to accept the attribute blocks, display their values and the real name in the generated table.

 

Attach a DWG file  (for example)  with a generated table and two blocks one normal (simple) and the other with attributes and the lisp code.

 

Thanks in advance for my time.

7 REPLIES 7
Message 2 of 8
pbejse
in reply to: mihai_bantas

change this

 

(setq blk_name (cdr (assoc 2 (entget ent))))

to

(setq blk_name (getpropertyvalue (getpropertyvalue ent "BlockTableRecord") "Name"))

HTH

 

Message 3 of 8
Moshe-A
in reply to: mihai_bantas

@mihai_bantas  hi,

 

Partially fixed (e.g you will get the real block name when it's dynamic block)

why partially? because when dealing with attributes blocks for table cell, along with attributes value you have to get the object ids of attributes definition and take-in consideration that there maybe numbers of that block with different attributes value and each of them have to be in a different row in table so to handle all that it's a big challenge Smiley LOL

 

good luck

moshe

 

 

Message 4 of 8
mihai_bantas
in reply to: pbejse

hi

 

Message 5 of 8
mihai_bantas
in reply to: Moshe-A

Hello Moshe-A,

I tested the code you modified ... it generates a strange table. I attach a picture of the table ...

PS. thanks for your advice and time

 
Message 6 of 8
dlanorh
in reply to: mihai_bantas

Read the last part of @Moshe-A 's reply re: block attribute values

I am not one of the robots you're looking for

Message 7 of 8
pbejse
in reply to: mihai_bantas


@mihai_bantas wrote:

 

 


 

Like this..sample result.PNGwhere the last column shows the attribute values of the block as it appears on the drawing

 

See the attached modified lisp file [ BLKQTY_PBE.lsp ]

 

;;  By : Gia Bach, gia_bach @  www.CadViet.com		;;;
;;		pBe April 2018				;;;

 

 

 

Message 8 of 8
mihai_bantas
in reply to: pbejse

hello

...the code goes fine ...I did not know about this revision of the code.... thanks for the time it's been given to this problem.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report