We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-10-19 08:12 PM - edited 2022-10-19 08:16 PM
When I make a macro call or a libraryglobal call within the object an it is saved, the called macros will get in the object header, which you can see when you convert the gsm file into an xml file.
Example:
?xml version="1.0" encoding="UTF-8"?>
<Symbol IsArchivable="false" IsPlaceable="true" MainGUID="BC55626E-C77B-D544-8B40-189E7E928E23" MigrationValue="Normal" Owner="1196638531" Signature="1196644685" Version="44">
<Ancestry SectVersion="1" SectionFlags="0" SubIdent="0" Template="false">
<MainGUID>F938E33A-329D-4A36-BE3E-85E126820996</MainGUID>
<MainGUID>B176ABF1-5813-478F-926B-28EE7C5DC1F7</MainGUID>
<MainGUID>4FD10D67-2F29-4844-A65A-6597589B0CB5</MainGUID>
<MainGUID>A73622DE-E40A-4E63-ADB7-52D13422BD06</MainGUID>
</Ancestry>
<CalledMacros SectVersion="2" SectionFlags="0" SubIdent="0">
<Macro>
<MName><![CDATA["My_Zone_MVO"]]></MName>
<MainGUID>DB0479B0-A4A0-E44B-B00E-700296C3A1F3</MainGUID>
</Macro>
</CalledMacros>
Here you can see the MainGUID of the called Macro.
If I change the name of the macro call to call another object, it will still call the old one which is saved by its GUID.
If I change the name of the macro itself, it still will be called.
If I delete teh macro, write a new one and give it the name of the old one, the macro will not be found because the GUID is different.
Does anybody know how to solve this problem?
2022-10-20 06:01 AM
In my experience, when scripting in GDL, if you rename the macro by just renaming the file in the operating system, the GDL object calling it will still work as it uses the embedded GUID as you mentioned.
But if I change the name of the CALLed object or macro in the main object, so long as there is a new object (macro) with the new name (and it has a different GUID), then when I save the main object it re-links to the new object with the new GUID.
I have not examined this in XML, but have not had trouble with linking to an old macro.
Barry.
2022-10-20 10:56 AM
Thank You Barry. The same I had in mind as well. So it seems that the problem only happens in AC 26. I checked AC 22 and 25 and there it works as expected.
2022-10-23 07:28 AM
Sometimes...the trick is to edit the caller while having the macro "changed" (but having the same name). After just resave the caller object it will eventually call the "new" file
2022-11-02 11:18 AM
Hi,
Please PM me with detailed step-by-step reproduction of what is different in AC26. The order of creating the macros might be important.
It can be fixed reliably only by decompiling-recompiling the library using LP_XMLConverter with makelibrary or finalizelibrary command.