The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Everything about GDL - Doors/Windows/Objects/Stairs etc. (Example: I created an object that prints an error message in 3D all the time, please help!)

Moderators: ejrolon, Barry Kelly, Karl Ottenstein, LaszloNagy, gkmethy, Gergely Feher

User avatar
By Juha Vesen
#160904
Hello vistasp,

I think it cannot be done. The autotext is kind of a version of this card game. The content can be shown but is not known :shock:

Code: Select allBlind man's bluff (also called Indian poker, or squaw poker or indian head) is a version of poker that is unconventional in that each person sees the cards of all players except his own.
The standard version is simply high card wins. Each player is dealt one card that he displays to all other players (traditionally stuck to the forehead facing outwards- supposedly like an Indian feather).
By Samppa Hannikainen
#162989
Hello,

I did some experimenting on this subject, and managed to write a script for reading manually exported projectinfo xml values into a string array. It gave me a chance to familiarize myself with the xml i/o addon. I think this is something like what Karl Ottenstein and Erwin Edel mentioned in this thread.

Anyway, I thought I could share this and maybe save somebody the trouble of doing it from scratch. The script below should be placed in the object's master script.

I've tested this on AC11 only, but I think it should work on later versions too. One thing that's still bugging me is updating the object's array when the xml-file is updated. It only seems to update on a full library update. Maybe someone could give some help on that?


Code: Select all!Project info XML Script
!-----------------------
!Usage:
!
!Project info needs to be exported manually every time something is updated.
!
!This script will query the exported file and return a string array projectInfo[n][2]
!(in which 'n' is the total number of project info entries)
!
!If you prefer to have the xml-file to loaded in libraries, set XmlInLibs=1
!If you prefer to select the file through dialog from another location, set XmlInLibs=0
!
!The returned array is organized as follows:
!projectInfo[1][1]=UIKey 1 [projectinfo entry title]
!projectInfo[1][2]=value 1 [projectinfo entry value]
!projectInfo[2][1]=UIKey 1
!projectInfo[2][2]=value 2
!
!..etc..
!
!------------------------


!-----------------------Initialize variables
XmlFilename=""      !Put your xml filename here, or set as parameter
XmlInLibs=1      !See description above

!The array
DIM projectInfo[][2]

!Xml handling
read = 0
nds = 0
openmode = ""
name = ""
val = ""
keyw = ""
cursor = ""
fixKeyEntries = 0
customKeyEntries = 0


!-----------------------Test XML filename
IF XmlFilename="" THEN GOTO 1


!-----------------------Initialize XML file for reading
IF XmlInLibs = 1 THEN                                    !either
   openmode = "rl"                                       !you have loaded the XML-file in your project libraries
ELSE                                                !or
   openmode = "rd"                                       !You want to point file location manually
ENDIF
channel = OPEN ("XML", XmlFilename, openmode)


!-----------------------Test XML file
read = INPUT (channel, "NewPositionDesc", "", cursor)            !Init cursor at root location
read = INPUT (channel, "GetNodeData", cursor, name, val, keyw)      !Get root node data
IF name # "ProjectInfo" THEN GOTO 1                           !Just a quick check


!-----------------------Feed 14 fixed entries to array
read = INPUT (channel, "MoveToNode FromFirstChild FixKeys", cursor, name, val, keyw)      !Move to FixKeys root
read = INPUT (channel, "NumberofChildNodes * Fix*", cursor, nds)                      !Count Fixed Key entries
fixKeyEntries = nds

read = INPUT (channel, "MoveToNode FromFirstChild Fix*", cursor, name, val, keyw)         !Move to first FixKey-entry

FOR i = 1 to nds
   read = INPUT (channel, "MoveToNode FromLastChild value", cursor, name, val, keyw)      !Move to value-entry
   read = INPUT (channel, "MoveToNode FromFirstChild * CDATA", cursor, name, val, keyw)   !Move to actual data

   projectInfo[i][2] = val                                                   !Store Data
   
   read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)               !Back up to value-entry
   read = INPUT (channel, "MoveToNode FromPrevSibling UI*", cursor, name, val, keyw)      !Move to UIKey-entry
   read = INPUT (channel, "MoveToNode FromFirstChild * CDATA", cursor, name, val, keyw)   !Move to actual data

   projectInfo[i][1] = val                                                   !Store Data
                        
   read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)               !Back up to value-entry
   read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)               !Back up to FixKey-entry
   read = INPUT (channel, "MoveToNode FromNextSibling Fix*", cursor, name, val, keyw)      !Move to next FixKey-entry
NEXT i      

read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)                  !Move Back to FixKeys root
read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)                  !Move Back to ProjectInfo root


!-----------------------Test custom entries
read = INPUT (channel, "NumberofChildNodes * Custom*", cursor, nds)             !Search for CustomKeys root entry
IF nds = 0 THEN GOTO 1                                                !If none, quit


!-----------------------Feed custom entries to array
read = INPUT (channel, "MoveToNode FromFirstChild Custom*", cursor, name, val, keyw)      !Move to CustomKeys root
read = INPUT (channel, "NumberofChildNodes * Custom*", cursor, nds)                   !Count Custom Key entries
customKeyEntries = nds

read = INPUT (channel, "MoveToNode FromFirstChild Custom*", cursor, name, val, keyw)      !Move to First CustomKey entry root

FOR i = fixKeyEntries+1 to fixKeyEntries+customKeyEntries
   read = INPUT (channel, "MoveToNode FromLastChild val*", cursor, name, val, keyw)      !Move to value-entry
   read = INPUT (channel, "MoveToNode FromFirstChild * CDATA", cursor, name, val, keyw)   !Move to actual data

   projectInfo[i][2]=val                                                   !Store Data

   read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)               !Back up to value-entry
   read = INPUT (channel, "MoveToNode FromPrevSibling UI*", cursor, name, val, keyw)      !Move to UIKey-entry
   read = INPUT (channel, "MoveToNode FromFirstChild * CDATA", cursor, name, val, keyw)   !Move to actual data

   projectInfo[i][1] = val                                                   !Store Data

   read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)               !Back up to UIKey-entry
   read = INPUT (channel, "MoveToNode ToParent", cursor, name, val, keyw)               !Back up to CustomKey-entry
   read = INPUT (channel, "MoveToNode FromNextSibling Custom*", cursor, name, val, keyw)   !Move to next CustomKey-entry
NEXT i


!-----------------------Close XML file
read = INPUT (channel, "ReturnPositionDesc", cursor, name, val, keyw)
CLOSE channel



1:   !Project info XML Script over