gdl2svg-Converter

Parametric GDL Icon Generator

This tool allows you to create UI icons for Archicad/GDL objects using simple script commands instead of drawing them manually. The syntax is similar to GDL 2D commands. Each shape instruction is converted into SVG internally, and you can export the result as a transparent PNG for use in library objects.

What it can do
    •    Draw UI shapes: lines, circles, rectangles, polygons, ellipses, arcs and arrowheads
    •    Apply stroke weight, fills, and custom colors (hex)
    •    Transform geometry with translation (ADD2), rotation (ROT2), and stacked DEL for rollback
    •    Define and reuse custom shape blocks with DEFINE … ENDDEFINE + CALL
    •    Automate placement using FOR … TO … STEP … NEXT loops (supports nested loops)
    •    Use variables and arithmetic expressions (x = i * 10 + 2)
    •    Handle nested transformations and nested function calls
    •    Export pixel-accurate SVG and transparent PNG files
    •    Support both absolute coordinates and GDL-style local transforms
    •    Auto-close unbalanced transforms for valid SVG output
    •    Designed for precise Archicad/GDL UI icon creation

How to use
    1.    Enter GDL-style drawing commands in the editor
    2.    Click Convert to generate the SVG preview
    3.    Download the SVG or PNG file
    4.    (Optional) Enter a custom filename before exporting
    5.    Use ADD2, ROT2, and DEL to position and repeat shapes
    6.    Use DEFINE / CALL for reusable blocks
    7.    Use FOR … STEP … NEXT for automated placement or grids
    8.    Combine transforms, loops, and blocks to build complex icons quickly

 beitragsbilder.pngGDL to SVG Icon Generator – Abbildung 1

GDL-style Icon Script Language

Coordinate System
Origin bottom-left. Units = pixels. No automatic scaling or centering.

Colors
Optional Hex color values (e.g. #000000).
Default: stroke = black, fill = transparent.

Shape Commands
LINE2 x1, y1, x2, y2, d (, #stroke) – straight line
CIRCLE2 x, y, r, d (, #stroke, #fill) – circle
RECT2 x1, y1, x2, y2, d (, #stroke, #fill) – axis-aligned rectangle by diagonal points
POLY2 n, x1, y1, …, xn, yn, d (, #stroke, #fill) – polygon with n points
ELLIPSE2 x, y, rx, ry, rot, d (, #stroke, #fill) – ellipse
ARC2 x, y, r, a1, a2, d (, #stroke) – circular arc (angles in degrees)
ARROW x, y, rot, len, wid, d (, #stroke, #fill) – arrowhead only (no line)
TEXT2 x, y, h, i, "Text", #Color - Text

Transformations
ADD2 x, y – translate local origin by (x, y)
ROT2 a – rotate local coordinates by a° CCW
DEL n – close last n transforms (default n = 1)
Transforms stack and apply to all following commands until DEL.

Subroutines
DEFINE name – start reusable block
ENDDEFINE – end block
CALL name – insert previously defined block

Loops
FOR i = start TO end STEP value – loop counter i
NEXT i – end loop, loop variable removed afterwards

Variables & Expressions
var = expression – assign numeric value
Supports + − * / and parentheses.

Example
DEFINE arrowShape
  ARROW 0,0, 0, 6, 3, 1, #000,#000
ENDDEFINE

FOR i = 0 TO 270 STEP 90
  ROT2 i
  CALL arrowShape
  DEL
NEXT i


beitragsbilder-5.png


Feedback and improvement ideas welcome.

Version 2 (2025-11-06)
- improved user interface

Version 3 (2025-11-10)
- fixed ZIP file error
- 2D Text added
- Definition of Icon Parameters
- Syntax Checking

Version 4 (2025-11-11)
- 1 HTML file split into HTML, CSS and JS files
- Export and import of created graphic scripts possible

 

 

gdl2svg-Converter

Download gdl2svg.zip

File size: 0.02 MB

Downloads: 138

Download

Notes on Privacy

  • • This page does not store any personal data.
  • • No conclusions about your person are possible: after you close this page, your IP address is kept in our traffic statistics only in fully anonymised form (11.22.33.44 becomes 0.0.0.0).
  • • This page uses no cookies and no tracking.
  • • Neither the data and scripts you enter nor the conversion result are saved.
Full privacy policy (in German) →