I'm pretty new to writing gsm and gdl stuff and I'm trying my hands on it to help out in the firm. The guy who does the scripting, writes it directly on Archicad. Which kinda baffles me. No intellisense, no syntax highlighting, no code snippets. It's like I've regressed back to 1990s.
So I've found an add-on on vscode but it doesn't read gsm and seems pretty buggy from the github documentation. I'm wondering (and kinda certain), if someone has created an addon for stuff like sublime, notepad ++ or vs 2022, to easily script and debug these kind of files. That said I'm also wondering what do you guys use and how do you go about it.
Side note, I'm more familiar with JS, and python for web dev... hence why I'm asking about these text editors and IDE.
thanks and I hope there's a dev friendlier way of scripting gsm/gdl stuff.
Lot's of experienced gdl'ers here commenting but they're imo not the ones a proper editor would target in the first place...it's the many people not yet into gdl...scared by the 80's interface and ditching it before even having tried. 27 or later... is very late for not such an archaic effort!? I know it's about priorities though...
Late to the party but I'd really like to chime in.
As most of you know I do a lot of scripting – and thus of course I loathe the lacking environment. I don't need to reiterate why the built-in editor is crap.
Because of my own needs I developed the plugin for Sublime Text (as per signature). I was staggered as well when I discovered nobody has done that before.
With HSF luckily Graphisoft has given us a wonderful workflow. I heavily disliked the XML way, just because language embedding feels always weird to me. The HSF approach is much cleaner and also behaves much better with version control systems like Git. And yes, all my code lives in Git.
With my plugin there is a direct link to the LP_XMLConverter, so no need for copypasting orgies. For some time now I also use VSCode. It's a great editor with rapid development. The official addon from Graphisoft lacks the link to the converter, true, but that's not really an issue. I've made a build system in half an hour – see my workflow below. Of course it helped I had done it before for my Sublime Text plugin. 
If you have a certain proficiency in GDL you can write larger batches of code before you'll need to test it. At least it is like this for me. But I can see that it seems easier just to do fast iterating without switching apps.
Now a few words regarding my common workflow:
Nearly all my objects start in Archicad where I hit "ctrl + alt + o" and I'm in a new object. I choose the subtype, make the parameters I need , fill in some basic structure, maybe even do a little prototyping. Then the object is immediately exported from Archicad and deleted from its embedded library. I have one or two big files where all development takes place. The main folder containing the objects will be linked as a lib.
Then I hop to my external editor of choice. Everytime I save a new .gsm gets built. All I need to do is to reload the library after alt-tabbing back to Archicad. And because I suggested that the Python connection should be able to send the "reload loaded libraries" command I don't even have to do that.
All in all it's not even slower than working on Archicad only 😉
: Why I don't use ST frequently any longer is a complete different topic on its own.
: How do I know you might ask. Well, I always start a project on (digital) paper with a pen in my hand. I know all details (>90%) beforehand.
Didn't even know about this, looks like I have a fun weekend ahead of me!
Super stoked to see how it all works!
@runxel, have you considered/ investigated porting your Sublime Text plugin to VSCode? I wrote some very basic pseudo python to run LP_XMLConverter from a VSCode Task, but your Sublime plugin is far superior! But VSCode seems to be becoming the industry standard IDE these days.
Also, you mentioned you are using Python to initiate the Library Reload - that sounds amazing! Is this included in the latest version of your Sublime Plugin? If not, i'd love be able to get my hands on the python script you are using for this.
Yes I considered that. I have even started to migrate a bit of the code, but since VSCode is an Electron app everything needs to be in Typescript. I had never used TS before so it was a slow thing and in the end GS overtook me, which I think is actually great. They acknowledged that there is a strong and thriving GDL community that needs and deserves better tools.
The library reload command is not yet included in my ST plugin. You can give it a go by yourself with Tibors add-on.
Thanks @runxel, yeah totally get that - if only GS's extension had the functionality that yours did it would be a total solution..
Thanks for the link to the extra python addons, that's awesome! God I wish GS would open up the python connector so much more - the possibilities are just endless if they did!
So I threw together this little proof of concept for my verion of working seamlessly between AC and VSCode using the FileWatcher VSCode extension and the Python Reload Library command.
It basically gives you the live version of the GDL in VSCode, every time you save in Archicad. And every time you save in VSCode, the library part will auto-reload.
The only one hurdle is that Archicad does not auto-refresh the GDL if you have the object open when you save in VSCode and Archicad marks it as [Read Only] - so you have to close the editor and reopen if you want to edit in Archicad - so close!
I've attached a little demo video and the source code.
- VSCode Workspace Settings to run the Filewatcher Extension (available here: https://marketplace.visualstudio.com/items?itemName=appulate.filewatcher)
- Copy Python Script vsgdl.py into the root folder of your workspace folder.
Please exercise extreme caution! I threw this together in an hour, so there is little to no testing, no error trapping, and I'm pretty sure the likelihood of accidentally overwriting your code is very high!