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

XML extension: how to make it work?

Sam Karli
Enthusiast
Hi,
I'm experiencing with the xml extension, but even cannot start it.

What's the problem with the following code (being in the Parameter script)?
channelTest = OPEN ("XML", "Teszt", "wl")

OUTPUT (channelTest, "CreateDocument", "", "Teszt")

CLOSE channelTest 
GDL/Python/C++ dev
4 REPLIES 4
Jochen Suehlo
Moderator
Read this first, maybe it helps:
http://gdl.graphisoft.com/tips-and-tricks/how-to-use-the-gdl-xml-add-on
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Sam Karli
Enthusiast
Thanks for Your help, not too much. 😞

It describes reading a (prepared) read-only doc. My problem is with creating a new xml by the OUTPUT command.

Such a poor documentation.
GDL/Python/C++ dev
Jochen Suehlo
Moderator
I haven't try, but I think the Script should be in the Master and OUTPUT has to be without brakes, like
OUTPUT channel, "CreateDocument", 0 , 	"Par_Set"
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Sam Karli
Enthusiast
Indeed.

This works:
ChannelTest = OPEN("XML", varFileNameWithFullPath , "wf")

OUTPUT ChannelTest, "CreateDocument", var1, "Teszt"
input (ChannelTest, "NewPositionDesc", "", varDesc)

OUTPUT ChannelTest, "NewElement AsFirstChild", varDesc, "Coord"
input (ChannelTest, "MoveToNode ToFirstChild", varDesc, var0, var1, var2)
OUTPUT ChannelTest, "NewText AsFirstChild", varDesc, GLOB_INTGUID

OUTPUT ChannelTest, "NewElement AsFirstChild", varDesc, "X"
input (ChannelTest, "MoveToNode ToFirstChild", varDesc, var0, var1, var2)
OUTPUT ChannelTest, "NewText AsFirstChild", varDesc, str (SYMB_POS_X, 8, 3)

OUTPUT ChannelTest, "NewElement AsNextSibling", varDesc, "Y" 
input (ChannelTest, "MoveToNode FromNextSibling", varDesc, var0, var1, var2)
OUTPUT ChannelTest, "NewText AsFirstChild", varDesc, str (SYMB_POS_Y, 8, 3)

CLOSE ChannelTest
But in the GDL Reference guide OUTPUT stands with brackets, I've checked.
Many thanks.
GDL/Python/C++ dev