License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

GDL XML Extension

Anonymous
Not applicable
Can anybody help me with the GDL XML Extension? I'm trying to decode it since 4 days and i have no idea how it works! The ArchiCAD 9 documentation is very confusing or i'm so stupid

I'm trying to teach my GDL how to output data like dimensions and price in a XML file so i can read it with an JAVA script. My Problem i have no idea how the GDL XML syntax works!

The best for me would be to download a GDL objekt where this GDL XML Extension script is use so i can whatch how to write it!
11 REPLIES 11
Frank Beister
Moderator
Have you read the XML-AddOn documentation in the GDL manual? Where is your problem exactly? What works, what doesn't? Have you written yet an example one could look at to see your eventually mistake?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
I have already read the GDL Documentation from Graphisoft but i dont check it.

My problem is:
1. This is my script for the channel
ch7 = Open ("XML", "G:/opt.xml", "wf")

2. I try to write something in the XML File. Exactly this is the biggest problem i dont have any idea how the GDL syntax works! The first command OUTPUT is very simple then i tell him the channel but the next command is the problem. In the GDL Documentation is written that i have to tell him a fieldID but what does this mean there is nothing in the Document so i can't give him a fieldID.

OUTPUT ch7, "NewComment insertpos","1","<!-- the comment itself -->"

3. Close the channel
CLOSE ch7

Later i like to read the data in the XML Object with the INPUT command and copy them and write the new data and the "old" in the same XML Object.

But first its important for me to write anything in the XML Object that i know how the command works!

I hope you understand me now!
Frank Beister
Moderator
Have you used the CreateDocument command at first, as written in the manual?
'w': [...] (Nach dem Befehl OPEN muss die Anweisung CreateDocument die erste ausgeführte Anweisung sein.)
Will be created the file on the hd? It will be empty, but does it exist? If not, try it without the path name.

Are you familiar with the XML format? The ID will probably be the position of the data-nodes (?).
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Frank Beister
Moderator
As it was told to you in the german talk you should first do some steps with the text i/o or the data i/o to get a feeling for the handling of external files, path names etc. The manual according to the XML AddOn does not seem as bad to me. 😉 But my knowledge of the XML-structure is more theroretical, too.

Why can't you read a dump text or database-file from JavaScript?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
I dont used this command because i creat a new document with the 'w' on the HD. An that is my only sucess on this project that he make a new document. I can try it but there is the next problem what should i write in this command when the fieldID is ignored?

OUTPUT ch7, "CreateDocument","","opt"
or
OUTPUT ch7, "CreateDocument","opt"

I know that the fielID is a position in the XML document but he makes a clear document and then i haven't a position to tell him.

I can send you my GDL object maybe you have a idea how to make it.
Frank Beister
Moderator
CreateDocument ist nur zulässig, wenn die Datei im Modus "Neue Datei" oder "Überschreiben" geöffnet wurde. In diesen Modi muss diese Anweisung zuerst ausgeführt werden, um das XML-Dokument zu erstellen.
Unexpected clear explanation in the manual. OPEN file and OUTPUT "CreateDocument". If it makes sense for you is not the question. It's the syntax.

The first one, I guess is right. The parameter is described as "ignored", but not as "not expected" (as i some other commands in GDL too).
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
insertpos kann folgendes sein::
AsNextSibling: Das neue Element wird nach der in fieldID angegebenen Position eingefügt
AsPrevSibling: Das neue Element wird vor der in fieldID angegebenen Position eingefügt
AsFirstChild: Das neue Element wird als erstes untergeordnetes Element des in fieldID (muss ein Elementknoten sein) angegebenen Knotens eingefügt
AsLastChild: Das neue Element wird als letztes untergeordnetes Element des in fieldID (muss ein Elementknoten sein) angegebenen Knotens eingefügt
Yes it is right the syntax is my problem how to write the hole shi.......t

In every command there is that word insertpos an i read that this word have a meaning (see at the Quote). I think i have a mistake in my syntax when i try to write something in the XML File because he makes a new document and then i get an error like "Syntax Fehler" and "Dateibearbeitungsfehler".

Do you have a example for me how to write this NewComment command?
Anonymous
Not applicable
I have another success he makes a new document an write something in it. I'm really happy about this because i'm sitting for 4 days on this problem. My mistake was the command CreateDocument but my next problem is to tell him the fieldID when i like to write something in the document with the OUTPUT command.
Frank Beister
Moderator
The fieldID will be the name of a node. I think, that it will create a XML tag. XML is an object orientaded data model. You have to declare a node and then you can assign a value to it. To "talk" or "read from" a certain node, you have to identify it by its name. As you do in text i/o to use the column number of the actual row.
Again my question: Are you familiar with the XML format? Do you have an aim of export format/structure? Can you create such an file "by hand" and post it?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!