The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Everything about GDL - Doors/Windows/Objects/Stairs etc. (Example: I created an object that prints an error message in 3D all the time, please help!)

Moderators: Barry Kelly, Karl Ottenstein, LaszloNagy, ejrolon, gkmethy, Gergely Feher

User avatar
By Erich
#187773
Do any of you use any outside programs for GDL code snippet management? Searching through my parts for that piece of code that fits my current needs, just isn't cutting it anymore.

I have found, and am currently trying, a program called CodeBox that seems fairly good (and has fantastic developer response). Does anyone have other ideas (Mac based)?


Also, if anyone else is using CodeBox, do you have a TextMate .tmTheme for it that works for GDL (to provide syntax highlighting)?
User avatar
By Karl Ottenstein
#187774
Erich wrote:Does anyone have other ideas (Mac based)?
Xcode 4 supports drag and drop code snippets. Will be free with Lion. Until then, Xcode 4 is $5 from the Mac App Store. (HUGE download though.) But, if you're wanting syntax highlighting for GDL you probably want to look at something else...?

Codebox looks pretty interesting.

K
User avatar
By Erich
#187775
Karl,
I think that Xcode is overkill for what I am looking for which is basically a code snippet library.

Thus far CodeBox has been very good. The program is light, starts fast, searches fast, and works fairly well for entering GDL snippets. There is a minor bug that prevents the menu item from showing in my case (there is a fix via Terminal, but I have not implemented it yet as my Unix programing skills are very very dusty).

Also, while CodeBox supports syntax highlighting for a huge number of languages, GDL is not one of them (not a big surprise). I contacted the developer and he indicated that the feature could be added, but he does it via a TextMate template and there isn't one for GDL that he or I could find (again not a surprise). Taking a look at TextMate, I was unable to quickly determine how to create such a template. So for now I am using CodeBox in plaintext format without highlighting. Thus far, I do like it.
User avatar
By Joachim Suehlo
#187781
I use Codebox from App Store, which has some nice features, for my GDL snippets (and other code snippets).
It is very simple, but If you do not have hundreds of categories, its quite perfect.
It costs only 4.99 $ and I think its worth the price.

I do not use textmate themes.
But Codebox has an export function to Coda ("open in Coda"), which I use for Web Site editing. Coda has syntax highlighting templates and I have started to build one for GDL (but not finished), so I can print my colored code (for code checking).
User avatar
By Erich
#187820
Joachim,

I am interested to hear how your Coda template comes along. Perhaps you can share examples once it is finished.
User avatar
By owen
#188290
CodeBox looked handy and you almost can't go wrong at $5. I can see it becoming quite useful, although that forced me to look at my code management (or lack thereof) yet again ... something i've never really found a satisfactory answer to.

What really caught my attention was the mention of syntax highlighting via TextMate themes - I remembered i had picked up TextMate a while ago but had never really thought about creating a GDL language bundle for it - i guess the software available to me and my desire to do it weren't in the same place at the same time.

So this thread put it back on the radar - I'd bought CodeBox, dusted off TextMate and dug into the documentation. Turns out creating a language bundle (syntax) and theme (highlighting the syntax) is actually relatively simple at least at a basic level. All the work is in the language bundle, which relies heavily on usage of Regular Expressions. Which i know very little about, so that was another thing to dive into.

Anyway on and off over the last couple of days i've put together the beginnings of both a Language Bundle and Theme. It is by no means complete in terms of capturing the full extent of GDL commands available, nor is it 'bug' free - I am attempting to learn Regex at the same time and so there are a few issues i have to figure out around correctly recognising command boundaries. But I think its a solid start and has shown enough potential that i think i will keep going at it.

Short term goals are:

- Styling (highlighting) of all GDL command keywords only (e.g CPRISM_ mat, mat, etc only, not CPRISM_ mat, mat, etc
- Styling of comments [!]
- Collapsing text blocks according to command pairs (e.g ADDX ... DEL 1 can be collapsed to hide code between to aid navigating long nested scripts
- Collapsing blocks based on a made-up comment string ( ! <---etc ... ! >---)

Due to my complete lack of regex 'skillz' I have been forced to assume a certain way of structuring code where GDL is flexible - e.g always using spaces to separate things even though GDL ignores spaces - so Param = X is recognized as two parameters separated with an operator whereas Param=X isn't. The upside to this - for me anyway - is it forces me to be a bit more disciplined in how things are written because they don't work if they aren't. When my knowledge of Regex allows i may go back and fix these restrictions. I've also made-up some of my own 'commands' for the language to enable things like collapsing code blocks based on certain comment strings which in GDL mean nothing, it's all about TextMate at this point.

Anyway .. I've attached the TextMate 'GDL' Language Bundle & 'GDL' Theme along with a sample .gsm (its really just text) you can open in TextMate showing what commands I have semi-working so far.

I will post updates as they come, but feel free to take and do with as you wish. If anyone has any questions, feedback or can offer any guidance (like 'run away!' or 'there be dragons there'...) i'd be glad to hear it.

cheers,

owen
Attachments
(7.47 KiB) Downloaded 420 times
User avatar
By owen
#188291
forgot to ask - does anyone know if its possible to add a TextMate language bundle to CodeBox? Seems you can only add the TextMate Themes for highlighting existing languages - not new languages themselves?

image of the sample file below
Attachments
Screen shot 2011-05-06 at 2.52.22 AM.png
User avatar
By Erich
#188302
Owen,

What a great start. I would suggest that you contact the CodeBox developer directly at codebox AT shpakovski DOT com to see if he can add the support. He seemed more that willing to help when I contacted him initially.