BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
GDL
About building parametric objects with GDL.

How to call a different Macro

Joachim Suehlo
Advisor

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?

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
4 REPLIES 4
Barry Kelly
Moderator

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.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Joachim Suehlo
Advisor

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.

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

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

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.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Learn and get certified!