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
Joachim Suehlo
Advisor
- GDLnucleus: https://gdlnucleus.com/
- GDLsublime: https://github.com/runxel/GDL-sublime
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
dushyant
Enthusiast
Joachim wrote:
- GDLnucleus: https://gdlnucleus.com/
- GDLsublime: https://github.com/runxel/GDL-sublime
Thanks Joachim. I tried GDL-sublime and could convert to HSF. But when I try to convert it back to GSM, it is not happening. It does say it finished converting, but the file does not get changed. Have you used this tool? Can you help with this?
runxel
Legend
Hi dushyant, I'm the author of GDL-Sublime.
For the conversion process the HSF folder needs to have the same name as the GSM.
Also note that errors in the GDL sometimes can lead to an abortion of the LP_XMLConverter, so nothing gets changed. The extension can't detect if the converter has terminated succesfully or aborted, so it still says "Finished".
If you show the console you will have a more verbose statement on what happened.


But I have to admit that I have converted to VSCode. Mainly because of the well made Git integration, whereas Sublime tries to sell an extra, overpriced client. Also they didn't fix many long standing bugs. Sublime Text 4 has released a few weeks ago, but I had not time to dive into it and probably won't.

There is an VSCode extension made by Graphisoft; it's okay-ish, but not really polished and lacks some of the stuff I did in my extension.

E.g. the GS extension doesn't provide any help on the conversion process.
If there is some interest I will share my setup.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
dushyant
Enthusiast
Hi runxel,

Thanks for your message. It converted to GSM successfully after I renamed the HSF data directory same as the GSM file, and kept it in the same location as GSM.

I have a query:
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.

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.

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.

While I was trying to figure out the conversion with the extension in Sublime, I tried Graphisoft's conversion-tool via the command-line and was able to produce the GSM:
.\LP_XMLConverter.exe hsf2libpart E:\customObjects\test\hsf E:\customObjects\test\generated.gsm

I only need a way to have the object updated in Archicad automatically after conversion, without the need to re-open it.

And yes, please share how you go about it, with your setup/workflow.

Thanks a lot!
Lingwisyer
Guru
I assume it would be the same as editing an object in a different AC instance, you don't need to reopen, just reload the relevant library.



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
dushyant
Enthusiast
Hi Ling,
So how do you set up a local directory with GSMs in it as a live Archicad library?
Barry Kelly
Moderator
dushyant wrote:
Hi Ling,
So how do you set up a local directory with GSMs in it as a live Archicad library?

Any folder that contains GSM objects can be loaded as a library.
It doesn't have to be an LCF file.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
dushyant
Enthusiast
Hi Barry,

I added a local directory as a 'linked library'. Thanks. I thought it should have been one of these: pla, ppa, pca, lcf, libpack.

It does not auto-refresh the object after changing the GSM though. You need to reload the library, which takes more than a few seconds as it seems to reload all the connected libraries. So is this the bargain we have to make in order to use an external editor? Or is there a way around it?

It's definitely faster when you save the changes in the opened object in Archicad. You see instant changes in the placed object without any reload. If only the built-in script editor had syntax-highlighting & a dark background ...

Thanks all for your help.
Barry Kelly
Moderator
dushyant wrote:
It does not auto-refresh the object after changing the GSM though. You need to reload the library, which takes more than a few seconds as it seems to reload all the connected libraries. So is this the bargain we have to make in order to use an external editor? Or is there a way around it?

I would assume so, but I have never used an external editor purely because it seems like extra steps.

dushyant wrote:
It's definitely faster when you save the changes in the opened object in Archicad. You see instant changes in the placed object without any reload. If only the built-in script editor had syntax-highlighting & a dark background ...
Can you copy & paste the script from the external editor into the open object in Archicad?
I have no idea, but if you can that may be faster.
So simply use the external editor as an editor, and not to save the object.

I am not worried about the dark background, but I would certainly love syntax highlighting.
And auto-completion of commands would be pretty good.

I often wonder what those creating objects at Graphisoft use.
Their objects are quite complicated.
Do they only use the GDL editor or an external editor?


Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11