GDL
About building parametric objects with GDL.

Generate preview picture with script?

Domagoj Lukinic
Booster

Hi there! 

I have a lot of old 2D objects and want to put preview picture on it, but I don't want to open every single part then, screenshoot, save exit. 

Is there a some faster way to generate preview picture for GDL objects other then a screenshot? 

Maybe to add a line of code that generates a preview pic from 2D or someting?

 

Thank you in advance!

3 REPLIES 3
Jochen Suehlo
Moderator

Yes, it is possible with the LP_XML_Converter, with a special command.

The Sub-ID for preview images must be set to 0.

4.2 Handling built-in images

Library parts can contain "built-in" images. LP_XMLConverter eases the access of this feature, too.

The steps of usage are the following:

  1. Create a folder for the image files and place images in it. The images can be of any format known by ARCHICAD.
  2. Refer the images from the XML files using the following syntax:
    <GDLPict MIME="image/png"
        path="subfoldername/filename.png"
        SubIdent="3"
        platform="Win"
        SectVersion="19"
        SectionFlags="0">
    </GDLPict>
    The path is relative to the main image folder, which is passed to the converter via the -img commandline parameter. SubIdent is the inner identifier of the image. This ID can be used to access the image from the scripts. In case of using -keepimagepath commandline option, these filenames are invariable after the conversion. Otherwise the filenames become subfoldername/GDLPict_X.ext, where X is the inner identifier of the image ('SubIdent').
  3. Use the image in the scripts of the library part containing it. The actual image can be identified by the SubIdent value, as this example shows:
    UI_INFIELD "parName", xPos, yPos, width, height,
            1, 3, 5, 1,        ! mind the "3"
            56, 50, 40, 40,
            1, "",
            2, "",
            3, "",
            4, "",
            5, ""

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

How complex would that be to do as someone who never used LP_XML_Converter?

Jochen Suehlo
Moderator

I created the GDLnucleus tool for MAC OS , which can do that in a nearly automatic way, after you have made some settings. It is a python-script which works together with Visual Studio Code.
Some Information you can find here:
https://www.b-prisma.de/anwender/gdlnucleus/
The latest version has to be updated, befor you can use it.
The Windows Version was created by Frank Beister an it can do the same, it works with Sublime Text, but I do not know if it is up to date now.
http://www.opengdl.org/Tools/Large-GDL-Object-Fission-Fusion
Both versions cost some money (MAC OS 25 Euro, WIN 50 Euro).

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de