Author Topic: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35  (Read 1453 times)

0 Members and 1 Guest are viewing this topic.

nini007

  • Newt
  • Posts: 58
Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« on: August 22, 2023, 03:04:40 PM »
Hello forum,

I would like to seek your knowledge on two points.

First of all, I'm currently using a "RENAMETAG" lisp from Gile which works very well, but I wonder if it would be possible to improve it. Currently this lisp prompts me for both the old and new tag. However, in most cases, my blocks have three or four attributes, which requires between 6 and 8 copy/paste operations.
Would it be possible to add this information directly in the lisp and simply select the blocks concerned?

Next, regarding the "CATP" lisp of "Patrick_35", I was wondering if it would be possible to add on-the-fly select functionality.
This would avoid having to retype the command each time.

Thank you in advance for your suggestions and ideas.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #1 on: August 22, 2023, 03:26:36 PM »
Note that RENAMETAG is only modifying selected block references, which will then become out-of-sync with the attribute definitions within their corresponding block definitions - is that what is intended?

nini007

  • Newt
  • Posts: 58
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #2 on: August 22, 2023, 03:48:44 PM »
Hello,

I didn't fully grasp the question where you mention "deviendront alors désynchronisées" (will become desynchronized).

The Lisp program RENAMETAG is designed to modify attribute label names. When I execute this program, it first asks me for the old label name, for example, "XXXXXXXXXXXXXX". Then, it prompts me for the new label name, which I choose to be "DESIGNATION". After that, I select all the relevant blocks, and the program replaces all the labels. However, the issue lies in the fact that I need to repeat this process multiple times, once for each label. For instance, if I have 4 labels, I need to repeat the process 4 times. If there are 3 labels, then I need to do it 3 times, and so on.

The goal is to be able to replace the label names with their new names simultaneously in a single operation.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #3 on: August 22, 2023, 04:44:59 PM »
But if you were to issue ATTSYNC at any time, all of your changes would be reverted back to the block definition - in my experience, it is not general practice to have block references whose attribute tags differ from those within the block definition, and certainly between other block references of the same name in the drawing...

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #4 on: August 22, 2023, 04:57:56 PM »
:)  Hi Lee,

This statement is so obvious I'm surprised (and disgusted) by the necessity for making it.

The proposed functionality is a slap in the face for anyone who has spent time attempting to build consistant standards.

Yes, I feel strongly about this :)
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #5 on: August 22, 2023, 05:15:14 PM »
The original post is here.

I warned the original poster of this behavior:
"Le code ci-dessus, par exemple, ne traite qu'une référence de bloc (argument obj) ce qui veut dire que lors des prochaines insertions du même bloc l'étiquette aura l'ancien nom et que si les attributs sont synchronisés (commande ATTSYNC) ils reprendront le nom d'étiquette de la définition."
"The code above, for example, only deals with a block reference (argument obj), which means that the next time the same block is inserted, the label will have the old name, and if the attributes are synchronized (ATTSYNC command) they will take on the label name of the definition."

There's a second version of RENAMETAG which deals with attribute definitions and synchronize the attribute references.
Speaking English as a French Frog

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #6 on: August 22, 2023, 05:29:51 PM »
Hi Gilles,

I had suspected that there would be a warning with the code.

. . . in fact , providing an additional solution that doesn't destroy the integrity of the block definition/reference relationship is typical of your professionalism.

It's just a pity that the code is reproduced without that warning.

Unfortunately the situation won't improve with the use of ChatGPT.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

BIGAL

  • Swamp Rat
  • Posts: 1416
  • 40 + years of using Autocad
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #7 on: August 22, 2023, 09:51:44 PM »
It is possible to make a custom dcl that displays the current tag name and then asks for new name, you can have a go with the attached Multi Getvals.lsp, you just get the selected block tag names and use that as the list with "please choose" at start.

A man who never made a mistake never made anything

nini007

  • Newt
  • Posts: 58
Re: Lisp enhancement by Gile "RENAMETAG" and "CATP" by Patrick_35
« Reply #8 on: August 24, 2023, 04:20:29 AM »
Hi,
I thank you all for your messages :smitten:.
Indeed that could be interesting, it would be necessary that it keeps in memory the choice. I tried using Multi Getvals.lsp (attached), what is the command to run the lisp?