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

layer in base attributo

  • Thread starter Thread starter dimasa
  • Start date Start date

dimasa

Guest
Hello, they are looking for a lisp or macro that can automatically create a layer with random or even simply white color, based on a text contained in the attribute of a block.
I try to explain myself better, within a project I have about 4000 identical blocks, in which 3 attributes are contained, in the attribute called qdr there may be about 60 different names, for each name I would like to create a layer automatically.
thanks for the help
 
command: (crealayerdatag "qdr")
the program is compiled, creates layers by examining all blocks and if this qdr tag creates its layer.
if in the content of the tag there is a value not allowed in the name of the layer the command creates error.
greetings
 

Attachments

thanks, it works perfectly, but obviously I was misinterpreted and incompletely, to the creation of the layers, each block should be inserted automatically inside the corresponding layer, currently all remain on the layer 0
 
I tried your lisp now, but it doesn't work entirely.
- does not create all layers properly as it did before, creates them to jump (on 63 layers that should create, creates 27)
- also in the layers created does not insert all blocks with that given text.
Thank you for your patience and I hope that your father's step again:)
 
to simulate the command I had to create a drawing with blocks having qdr tags, insert a twenty, change the value of the attribute, as well as write the code.
I can't say it works from me.
attach the dwg, even just the part of the blocks tagged qdr, at least I don't have to go to tentons.
 
to simulate the command I had to create a drawing with blocks having qdr tags, insert a twenty, change the value of the attribute, as well as write the code.
I can't say it works from me.
attach the dwg, even just the part of the blocks tagged qdr, at least I don't have to go to tentons.
hi, attached the dwg with the affected blocks,
I have done some tests, it works alternately:)
- if I load the lisp, and launch it with the command (crealayerdatag "qdr"), it presents the problems I have previously exposed to you, placing in the final the question whether or not I have to delete layers.
- or, it works perfectly and opens the autocad support window several times, (without an apparent reason)
- or if they select all the blocks it works perfectly and opens me other windows.

to learn lisp think can be a good start the book my lisp Can you give me some advice?
 

Attachments

"My lisp" is great for learning.
I fixed the command, there was a mistake in assigning the color to the layer.
now the file is editable, before performing the purge operations and puts all entities on layer 0.
 

Attachments

so much of a rpor hat.
extreme availability and mastering of the lisp at inverecondition levels:giggle:.

that you can have a great 2021.
 

Forum statistics

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

Members online

No members online now.
ciao
Back
Top