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

Filepath as GDL variable

Hi,

I need to be able to find the current project filepath as per the autotext <FILEPATH> and store this information in a variable. I am currently using a folder scanning routine that will search predetermined folder locations for the name of the current project to find its location however I now need to be able to find the file location no matter where it is placed.

The following GDL will give me the correct information as text, but I need to have this file location as a variable for other use (File I/O etc)

TEXT2 0.0, 0.0, "<FILEPATH>"

If anyone knows if this can be accomplished or any other ideas can you please let me know.

Kind Regards,
Danny
8 REPLIES 8
Frank Beister
Moderator
AFAIK there is no REQUEST, REQ or GLOBAL to return the full filepath. And autotext can't be read out of GDL. IMHO: No way.
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
Thats disappointing to hear especially when the <FILEPATH> autotext is so close and can be scripted into text within GDL.

Could this functionality be written as a custom API - perhaps a custom GDL REQUEST?
Frank Beister
Moderator
This could be written as API, but the add-on has to be loaded in every AC-session the object is used in.
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
This information can now be obtained via a request in AC10 (although this addition to the existing request is not documented by Graphisoft).
rrr=REQUEST("Name_of_plan", "", prj_name, prj_fullname, prj_path)
TEXT2 0.0, 0.0, prj_name
TEXT2 0.0, -1.0, prj_fullname
TEXT2 0.0, -2.0, prj_path
The above code will return the short name, full name and project path of the currently open project (assuming the project has been saved).

Hope this helps someone.

Danny
Frank Beister
Moderator
Great! Where do you have it from? Trial and error? Found in another object? GS itself?
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
I found these extra parameters through trial and error. Sometimes I add extra variables to the requests (especially when version upgrades have occured) and this one paid off.
Anonymous
Not applicable
Thanks Danny for finding this!

Many times I would like to know the platform where the GDL
is running. If I remember right there was a REQUEST for this
a long time ago, but nothing working at the moment


With Your code the platform is cleared out soonest;
rrr=REQUEST("Name_of_plan", "", prj_name, prj_fullname, prj_path)
len= strstr(prj_path, prj_fullname)-1
ddd= strsub(prj_path,len,1)
if ddd=":" then
platform= "It's a MAC"
else
platform= "It's a WIN"!--or something even wilder
endif
TEXT2 0.0, -3.0, platform


TEXT2 0.0, 0.0, prj_name
TEXT2 0.0, -1.0, prj_fullname
TEXT2 0.0, -2.0, prj_path


--
Regards, Juha
Anonymous
Not applicable
…And thanks Frank -> here was Your REQUEST tip alive and kicking!

http://archicad-talk.graphisoft.com/viewtopic.php?t=5182&start=0&postdays=0&postorder=desc&highlight=platform