ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

GDL

by runxel ST2/ST3

:pencil: A Sublime Text package for the programming language GDL (Geometric Description Language)

Details

  • 3.0.6
    1.3.3
  • github.​com
  • github.​com
  • 2 months ago
  • 3 hours ago
  • 4 years ago

Installs

  • Total 521
  • Win 335
  • OS X 133
  • Linux 53
Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4
Windows 1 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1
OS X 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

GDL-sublime

A bundle to make GDL available in Sublime Text.

Version

dark color scheme

What is GDL?

GDL means 'Geometric Description Language'. ArchiCAD uses it to define a library part.

Many ArchiCAD users are making their own library parts, sell them or even publish them for free on sites like BIMComponents, while others just want to modify the provided ones. But they are all tied to the – unfortunately horrible – built-in object editor which is stuck in the 80's or so. It doesn't even have line numbers!

But salvation is here!
The purpose of this package is to give you the chance to comfortably write code in the best editor of the galaxy – Sublime Text.

This package provides the whole thing: from syntax highlighting (with a well aligned color scheme) to auto completion, global goto, snippets, and last but not least a build system for your scripts.

Installation

Using Sublime Package Control

:whitecheck_mark: _recommended
If you are using Sublime Package Control, you can easily install the bundle via the Sublime Text -> Preferences > Package Control: Install Package menu item.

Using Git

:robot: Alternatively you can install the bundle and keep up to date by cloning the repo directly into your Packages directory in the Sublime Text application settings area.

Go to your Sublime Text Packages directory and clone the repository using the command below:
git clone https://github.com/runxel/GDL-sublime "GDL"

Download Manually

:arrowdown: _not recommended – you won't get updates! :rotating_light:
- Download the files using the GitHub .zip download option - Unzip the files and rename the folder to 'GDL' - Copy the folder to your Sublime Text Packages directory i.e. - Windows C:\Users\<yourname>\AppData\Roaming\Sublime Text 3\Packages\GDL - OS X: ~/Library/Application Support/Sublime Text 3/Packages/GDL

Usage

From now on you can select GDL as the current language in the bottom right corner of ST and enjoy all the benefits. For files with the .gdl extension it will be automatically active.
For the coloring (meaning the proper highlighting) there are two choices. By default a light color scheme will be applied.
I personly like the dark coloring more providing fatigue-proof coding. To change the use of a color scheme go to Preferences > Package Settings > GDL > Settings.

Copy one of these into the file on the right and save:

Dark:

{  
    "color_scheme": "Packages/GDL/GDL-dark.sublime-color-scheme"  
}

Light:

{  
    "color_scheme": "Packages/GDL/GDL-light.sublime-color-scheme"  
}

light color scheme

Don't like the themes?

You can edit the .sublime-color-scheme files directly. But remember to copy and rename the provided one. Otherwise an update would overwrite your changes.

GoTo, Auto completion, Snippets

The “Goto” feature of Sublime Text is pretty powerful. To gain full access you must use Sublime projects. If you e.g. quickly want to got to a subroutine place your cursor into the name and press F12. You will then jump directly to the definition.
Auto completion takes place automatically, if you're typing. You can force auto completion via ctrl + space.
I have included some example snippets. Try it out by typing in: comline and then press TAB ↹.
Voilá! There's a divider.
! ---------------------------------------------------------------------- !

I hardly encourage you to modify and extend the snippets, so they will suit your needs.
You will find all the shipped snippets in the Snippets folder.

Workflow

With the advent of ARCHICAD 23 we don't longer need third-party apps like GDLnucleus for a Sublime Text driven workflow. The LP_XMLConverter, which is part of every Archicad installation, can now convert .gsm directly into subsequent .gdl scripts and vice-versa. This means an end to the abundant copy & pasting orgy of the past.

To use this feature you first need to set the path to where your ARCHICAD is installed. Open the package settings again, with the pencil icon on the left you can copy the respective item from the left to the right pane. Change the path accordingly.
Afterwards drag and drop a folder with your 'gsm' (I recommend different folders for different gsm's) into Sublime Text and then create a Sublime project via Project > Save Project As…. Other benefits are a better working 'goto', 'auto completion', and the possibility to fast switch between different coding sessions on various gsm's.
You can now use the the two conversion options in Tools > GDL. For a quick access both items are reachable via a right mouse click on the editor pane and key bindings on each.
The default for Convert to script (gsm ⯈ hsf/gdl) is ctrl+shift+H. Build GSM from HSF (hsf/gdl ⯈ gsm) has ctrl+shift+alt+G. Of course this can be adjusted to your taste.

 
cmd args  

If you need to provide additional arguments for the LP_XMLConverter, you can do so by Project > Edit Project, then copy this into the open file:

"cmdargs":
{
    "to-hsf": "<args>",
    "to-gsm": "<args>"
}

where <args> is to be replaced. If you don't need it, you can leave it empty. To check the possible args you can run the LP_XMLConverter with the -? argument to get help. NOTE: AT THE MOMENT IT SEEMS THAT THERE ARE NO SUPPORTED ARGUMENTS FOR THE GSM-HSF-GSM WORKFLOW.

 
 

Getting Started With Sublime Text

New to Sublime? Then I can recommend this excellent and free video tutorial by nettuts: Perfect Workflow in Sublime Text.

Support

Does this plugin help you in your daily work, or just want to say thanks?
Please consider donating to sustain working on this plugin.

ko-fi

Beerpay