We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Connecting an external editor to Archicad to edit the scripts

dushyant
Enthusiast
Hi

Does anyone know if there's a way to connect an external editor (like visual studio code) to Archicad, to edit the scripts of an object? This is to have syntax highlighting, better keyboard controls (like vim) and for a dark background soothing to the eyes.

I know the script can be copied into an external editor and then pasted back into the script window in Archicad, but it's not practical when you have to keep testing the effect of frequent changes in the script.

Thanks.
12 REPLIES 12
dushyant
Enthusiast
Hi Barry,

Yes, the scripts can be copied between the external editor and Archicad's script editor. Not a very comfortable thing to keep doing while you're trying to debug or tweak some values.. Anyway, will make do with it

Yes, now that you mention it, I wonder what dev-environment they use at Graphisoft to build their objects.

And I would also like to know the dev-setup of other users here in the community. So please share

Thanks!
runxel
Legend
Great to hear you managed it, dushyant!

dushyant wrote:
What is the actual workflow in this scenario to go about developing in GDL and testing with Archicad? Yes, I got the GSM updated. Now do I have to again open object in Archicad to have it updated? I'm not sure if a local directory can be linked as a library in Archicad.
As Berry has mentioned you can just link any folder into the library.
Yes, you have to reload the library after, but I've set that command to an easy reachable keystroke and for me it rarely takes more than second to reload the libs.
In the future we could send a command via the Python connection which will automatically reload the libraries.


dushyant wrote:
I checked out Graphisoft's GDL plugin for VSCode. I has syntax highlighting and some code-completion. I could not find if it can convert b/w HSF <-> GSM.
Like I said, it can't.
I made a custom setup where this works, I will share this in a later post.

dushyant wrote:
So are you moving Sublime's GDL plugin to VSCode? I liked your syntax highlighting in Sublime. But VSCode is my primary editor at the moment and would prefer something of this sort in there.
No. I had already a lot of stuff ready, but GS beat me to it. At the moment I have no time to make a competing (but better) product. Instead I hope that GS will man up and just open source this thing already. No clue why they did not already do this. It would help everybody.
Also the next big step, speaking in technical terms here for a second, would be to create a Language Server (LSP is a technology Microsoft invented). This Server can parse the code and is much more robust than the stuff used right now. At the moment syntax highlighting is done by big big ugly Regexes. And those are slow and ain't not smart. A server could easily e.g. detect if a variable is bound to be a string or numerical value, and then can say to the editor "please color this differently". It's very powerful, it's the future.

I wonder what dev-environment they use at Graphisoft to build their objects.
I wonder, too! For a while there was a screenshot of Sublime Text with my extension on the GDL online reference.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
dushyant
Enthusiast
Hi runxel,

Thanks for sharing your thoughts.

I think it's taking time to reload libraries at my end because the template I'm using has some BIMcloud libraries which also get updated every time. (Perhaps I could work with the default Archicad template for object building.)

Yes, it makes sense to not invest time into creating another VSCode extension for GDL when Graphisoft has started one. And it would be great to let the public contribute & develop it further. It was interesting to learn about 'language servers'.

There were certain requirements of the GDL-Sublime extension that I discovered, including the one you told about the HSF directory to be of the same name as the GSM. I also found that the GSM file needs to be alongside the HSF directory for the conversion from HSF to GSM to work, even if the exported GSM goes to another location. (Not sure why HSF to GSM conversion requires the GSM file.) Maybe these notes could be added in the 'ReadMe' of GDL-Sublime.

Thanks.