GDL
About building parametric objects with GDL.
SOLVED!

Label for hatch

mus-a
Contributor

I would to create a label that shows the contour pen,  pen of the background fill and pen of the fill pattern.

I cannot extract those information with the default Autotext. I noticed that when when I'm creating custom label with Autotext, the information for Autotext has this kind of code :

 

paragraph "AC_PRG_12"      1,            0,            0,            0,            1

    pen     penAttribute_1

    set style "AC_STYLE_1"

        "<PROPERTY-B9179DB7-97BC-4985-94DC-06C201F79EF4>"

endparagraph

paragraph "AC_PRG_13"      1,            0,            0,            0,            1

        "<PROPERTY-BE376478-6966-4892-BEC7-4CB72ABF4003>"

endparagraph

paragraph "AC_PRG_14"      1,            0,            0,            0,            1

        "<PROPERTY-8E19BE5F-D487-4BEC-9281-B34CA2355292>"

endparagraph

textblock "AC_TEXTBLOCK_6" 21.71378406315,      1,            0,            1,            1,            1, 

        "AC_PRG_12", "AC_PRG_13", "AC_PRG_14"

richtext2 12.27684530913, 13.27296877469, "AC_TEXTBLOCK_6"
Is there a property code that would give me back f.e the background fill? If not what would be the easiest way to get those information for the hatch? 
 
Cheers!
 
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
mus-a
Contributor

Thanks for your reply! I didn't try chatGPT, but that's a great idea!

 

Update:I tried it now those property codes, but it gives back "#".I wonder why it doesn't work, while the others like the name of the fill works perfectly. Maybe chatGPT gave the wrong property code?

 

Meanwhile with big help of my coworker, we found this solution - to use General Libpart Parameters and it works like a charm. So for those who looks for something similar in the future, here they are:

 

FILL_LINETYPE line type of the fill
FILL_FILL fill type of the fill
FILL_BMAT_NAME building material name of the fill
FILL_BMAT building material index of the fill
Compatibility: introduced in ARCHICAD 21.
FILL_FILL_PEN pen of the fill pattern of the fill
FILL_PEN pen of the fill
FILL_FBGD_PEN pen of the background of the fill
 
 

View solution in original post

4 REPLIES 4

Have you tried chatGPT? I don't know GDL, I can't correct it if it's wrong but it's worth a try.

 

 

"Yes, in ARCHICAD GDL development, you can use property codes to extract information about the attributes of an object, such as the contour pen, pen of the background fill, and pen of the fill pattern. However, not all properties are available for all objects.

To get the pen of the background fill, you can use the property code "<PROPERTY-B5F6E5A6-5B10-47A6-9B6D-2116C2DC1C89>" in your label's Autotext code. This property code extracts the pen attribute of the background fill. Here's an example of how you could use it:

 

python
paragraph "AC_PRG_12" 1, 0, 0, 0, 1 set style "AC_STYLE_1" "<PROPERTY-B5F6E5A6-5B10-47A6-9B6D-2116C2DC1C89>" endparagraph

 

 

To get the pen of the fill pattern, you can use the property code "<PROPERTY-C66309EA-7B06-46AE-9F8F-33E1567AC107>" in your label's Autotext code. This property code extracts the pen attribute of the fill pattern. Here's an example of how you could use it:

 

python
paragraph "AC_PRG_12" 1, 0, 0, 0, 1 set style "AC_STYLE_1" "<PROPERTY-C66309EA-7B06-46AE-9F8F-33E1567AC107>" endparagraph

 

 

For the contour pen, you can use the "Pen" command in GDL to explicitly define the pen attribute of the object. Here's an example of how you could use it:

 

python
Pen(contour_pen) paragraph "AC_PRG_12" 1, 0, 0, 0, 1 set style "AC_STYLE_1" "Contour pen: " contour_pen endparagraph

 

Note that you would need to define the variable "contour_pen" in your GDL script to hold the value of the contour pen attribute."

arch. ernest atanasiu
AC 10-26 INT/GER/FR on Win 10/ Win 11
Solution
mus-a
Contributor

Thanks for your reply! I didn't try chatGPT, but that's a great idea!

 

Update:I tried it now those property codes, but it gives back "#".I wonder why it doesn't work, while the others like the name of the fill works perfectly. Maybe chatGPT gave the wrong property code?

 

Meanwhile with big help of my coworker, we found this solution - to use General Libpart Parameters and it works like a charm. So for those who looks for something similar in the future, here they are:

 

FILL_LINETYPE line type of the fill
FILL_FILL fill type of the fill
FILL_BMAT_NAME building material name of the fill
FILL_BMAT building material index of the fill
Compatibility: introduced in ARCHICAD 21.
FILL_FILL_PEN pen of the fill pattern of the fill
FILL_PEN pen of the fill
FILL_FBGD_PEN pen of the background of the fill
 
 

Haha, this is ChatGPT response when I told it was wrong. it's very polite:

 

"It's possible that the property code you used is incorrect or not applicable for the specific element you are trying to retrieve the value from.

However, as you have discovered, the General Libpart Parameters provide a better solution to get the information you need about the fill and its properties. These parameters are specifically designed for use in GDL scripts and provide a wide range of information about the fill, including line type, fill type, building material name and index, and the pens of the fill and its background.

So, using these parameters would be a better approach to get the information you need about the fill and its properties."

 

arch. ernest atanasiu
AC 10-26 INT/GER/FR on Win 10/ Win 11

haha 🙂 i also asked ChatGPT to generate list of lib part parameters for a fill. Also not correct 🙂

 

 

"Certainly! Here is a list of common libpart parameters for fill in ArchiCAD GDL:

  • FILL_TYPE: Type of fill used in the object (e.g. Solid, Pattern, Gradient, Image).
  • FILL_ANGLE: Angle of the fill pattern or gradient.
  • FILL_SPACING: Spacing of the fill pattern or gradient.
  • FILL_COLOR: Color of the fill.
  • FILL_BACKGROUND_COLOR: Background color of the fill.
  • FILL_FOREGROUND_COLOR: Foreground color of the fill.
  • FILL_PATTERN: Name of the fill pattern used.
  • FILL_GRADIENT: Name of the gradient used.
  • FILL_IMAGE: Name of the image used for fill.

These parameters can be used in libpart objects to specify the fill properties of an object. Depending on the type of fill, some of these parameters may not be applicable. For example, FILL_PATTERN and FILL_GRADIENT are only relevant when FILL_TYPE is set to "Pattern" or "Gradient", respectively."