LogicMachine Forum
LogicMachine - Modify Objects name - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: LogicMachine - Modify Objects name (/showthread.php?tid=6257)



LogicMachine - Modify Objects name - ALEJANDRO - 18.01.2026

Good evening,

I've loaded a Logic Machine 5 with a large number of objects, some virtual, some standard, etc.

My question stems from another issue: the vast majority of these objects share two letters that are almost always repeated, specifically the following naming convention: "P1". (Image attached.)

My question is quite simple: I want to create a backup and load these objects into two other Logic Machines. The problem is that in the second and third Logic Machines, instead of "P1", I need to replace it with "P2" and "P3".

Is it possible to do this without having to go object by object? Is there a quick way to do it? Thank you very much.

Best regards,
Alejandro A.


RE: LogicMachine - Modify Objects name - Daniel - 19.01.2026

You can use grp.create in script
https://kb.logicmachine.net/libraries/lua/#grpcreateconfig
just make sure to add forcename = true to grp.create config to overwrite name for an existing object


RE: LogicMachine - Modify Objects name - admin - 19.01.2026

Run this script once:
Code:
db:query('UPDATE objects SET name=REPLACE(name, "P1", "P2")')



RE: LogicMachine - Modify Objects name - ALEJANDRO - 22.01.2026

I understand what you're saying I should do, the problem is that would only change the name to P2. What I'm trying to do is change this:

BA_P1-4_A--CONSUMOS.Energia_Electrica

BA_P2-4_A--CONSUMOS.Energia_Electrica

upps, sorry, I didn't see last answer, thanks