We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-03-30 04:32 AM - last edited on 2024-09-24 10:30 AM by Doreena Deng
Hello!
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.
2022-04-01 12:12 AM
Didn't even know about this, looks like I have a fun weekend ahead of me!
Super stoked to see how it all works!
2022-04-01 07:49 PM
Doors :). We suffer from localized doors that have the gastly >1025 parameters problem with our localized doors which causes all kinds of mishaps.
2022-04-12 03:48 AM - edited 2022-04-12 03:49 AM
@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.
Cheers,
Scott
2022-04-12 11:44 PM
Hey @scottjm
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.
2022-04-13 08:34 AM
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...
2022-04-17 07:26 AM
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!
2022-04-18 08:40 PM - edited 2022-04-18 09:08 PM
Hi @scottjm
Thanks for your code, that's super exciting!
2022-04-19 12:32 AM
Whoa! I think this is the closest solution I've seen. AMAZING WORK!
2022-04-27 05:49 PM
Doors and windows are currently being overhauled, if you want to pm me about your door needs I can see if that fits into how I'm doing things.
My doors are super custom to my template at the moment.