Code Red => AutoLISP (Vanilla / Visual) => Topic started by: nini007 on November 10, 2021, 03:31:57 AM
Title: Change the layer of attribute labels in a block
Post by: nini007 on November 10, 2021, 03:31:57 AM
Hello the forum,
I need your help😀. I have a "BIL" block on the "0-INFO-LOCAL" layer made up of three attributes on the "0" layer.
I would like by a lisp or any other command to change the layer of the labels of the attributes "0" in "0-INFO-LOCAL" or any other layer of my choice. There is indeed the command "DEFDUCALQUE" the problem is that this only moves on DUCALQUE or DUBLOC. I tried this macro:
^C^C-MODIFBLOCK;BIL;chprop;;_all;CA;0-INFO-LOCAL;_bclose; that doesn't work, I don't understand the error. I also tried to change directly in my original block, re-import it and redefine all blocks unfortunately it doesn't work.
Does anyone have a tip or a lisp because I have plans with dozens of attributes to change.
PS: block in the attached file
thank you in advance for your help Best regards
Title: Re: Change the layer of attribute labels in a block
Post by: kpblc on November 10, 2021, 05:45:22 AM
I think the better way is to change attribute definitions to layer "0", all properties "ByBlock" and then _.attsync command
Title: Re: Change the layer of attribute labels in a block
Post by: nini007 on November 11, 2021, 05:39:04 AM
Hello,
Thank you for your message and your help. Yes your proposal is fine unfortunately I have to do it on several dozen shots and do the manipulation on two different name blocks. I would have liked if it is possible, maybe not, to automate the commands with a lisp, a macro or a script.
Best regard
Title: Re: Change the layer of attribute labels in a block
Post by: kpblc on November 11, 2021, 11:24:22 PM
Title: Re: Change the layer of attribute labels in a block
Post by: nini007 on November 12, 2021, 04:53:41 AM
Hello :-),
I thank you for your message. Pretty works for your code, it works great. I make two small modifications in your code, I added "c:" and change the layer "0" by the layer "0-INFO-LOCAL" One last little thing if possible, to be able to put the name of the block in the code so that it does not manually select it ? :idea:
Best regards
PS: no problem my English is not great either, more comfortable with French or Italian ;-)
Title: Re: Change the layer of attribute labels in a block
Post by: kpblc on November 12, 2021, 12:44:26 PM
Title: Re: Change the layer of attribute labels in a block
Post by: nini007 on November 14, 2021, 06:57:41 AM
Hello :-),
Thank you for your message and for your help :wink:. Sorry, maybe I misspoke.
I would have wanted the name of the block to be in the code without having to select it and write its name.
Best regards
Title: Re: Change the layer of attribute labels in a block
Post by: nini007 on November 26, 2021, 03:20:09 PM
Hello :-D, I have code which modifies the text of the attributes and I would like to modify some additional options. For color and rotation it was easy, I found it to be "color and rotation" --> (setpropertyvalue e "Color" 5) and (setpropertyvalue e "rotation" 0)
I would like to know what the following options are called: --> Text style, width factor, slant angle, etc.
For the width factor I tried (setpropertyvalue e "width" 0.75), it doesn't work.