Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

edit the GUID

alemanda
Advocate
Hi to all,
is it possible in someway overwrite the GUID?
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
8 REPLIES 8
Laszlo Nagy
Community Admin
Community Admin
I believe the GUID is automatically assigned to library pats by ArchiCAD when they are created.
So I think it is not possible.

I don't know if it is possible using API or not.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Jochen Suehlo
Advisor
I changed the GUID of a new object to the number of an excisting object, that the new one should have, so it will be recognized.
This was not possible in ArchiCAD; first I converted both objects into XML files with the XML Converter, than I changed the GUID within the XML file, then converted the new object back to gsm.
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
alemanda
Advocate
XML converter? Where can I find it?
How does it wokrs?
Anyway this is a very good new!!!
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
Jochen Suehlo
Advisor
XML Converter is a bit tricky to use, because it is a command line tool.
AC 14 has it within its directory. FOR AC 13 you have to download the Library Developer Toolkit at:
http://www.graphisoft.com/support/developer/downloads/

For use of the Converter take a serach in this forum "XML Converter"
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Barry Kelly
Moderator
Doing a "Save As" and giving the object a new name will change the GUID I believe.
But you have no control over what it is.
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
ztaskai
Graphisoft Alumni
Graphisoft Alumni
As Barry told, you get a brand new MainID if you save the object to a new location via 'save as'. On the other hand, you can claim the MainID of an other object by overwriting it in 'save as'.

This method works in v14 but I'm not sure about v13.

Regs,
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
Karl Ottenstein
Moderator
ztaskai wrote:
As Barry told, you get a brand new MainID if you save the object to a new location via 'save as'. On the other hand, you can claim the MainID of an other object by overwriting it in 'save as'.

This method works in v14 but I'm not sure about v13.

Regs,
Thanks for this, Barry and Zsolt. But, what a pain...

I'm helping someone transition from 9 to 14 right now, and their old custom library parts reported as duplicated in the 14 lib manager. On looking, the root GUID was identical for non-identical parts. I wasted some time doing Save As with each part, one by one, back to the same name - only to find no improvement.

How frustrating that you have to do a Save As to a NEW name to get the base GUID to change ... and then delete the original part, and optionally rename the newly named part back to the desired name... and that this must be done one, by one.

Further frustrating that this migration process is not discussed anywhere in the AC 14 Help or Reference Guide, nor on the Wiki.

So, rambling with a few more keywords in this post in case someone else runs into this issue and does a forum search. 😉

Karl
One of the forum moderators
AC 27 USA and earlier   •   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
ztaskai
Graphisoft Alumni
Graphisoft Alumni
Hi Karl,

Dropping explicit controls over the GUIDs was intentional. The design tries to emphesize the nature of libpart identification. I'm confident it is more intuitive for people less experienced with objects. It is a hassle for you, of course:(

I'd like to add one more thing for later finders of this thread (as it may be too late for you). If I had to give new GUID to more than 12 elements, I would convert them to XML using LP_XMLConverter. There you can make a mass-replace replacing the main part of the ID with the revision part (which just serves as a reliable new-GUID-source for the operation).

In Perl it goes like this:
binmode INFILE;
my $fileContent = <INFILE>;
close (INFILE);

if ($fileContent =~ /<Ancestry[^>]+Template="no"[^>]*>/) {
  @lines = split (/\n/, $fileContent);
  @lines = map {$_ = $_ . "\n"} @lines;
  $/ = $irs;

  if (!(open (OUTFILE, '>' , $origname))) {
    print $logFileHandle "Error: Unable to write $origname. Skipping.\n";
    return;
  }
  select(OUTFILE);
  binmode OUTFILE;
  foreach $_ (@lines) {
    if (m/<Symbol([^>]+)UNID="\{[^\}]+\}-([^\"]+)"(.*)/i) {
      print "<Symbol$1UNID=\"$2-$2\"$3\n";
    } else {
      print ("$_");
    }
  }
  close(OUTFILE);
  select (STDOUT);
  print ".$origname...\n";
}
I also attached a full Perl script changin the IDs of a folder of XML fomat library parts.

HTH,
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...