Find the next step in your career as a Graphisoft Certified BIM Manager!

GDL
About building parametric objects with GDL.
SOLVED!

Foreground & Background Fill Pens for Fragment2

Nader Belal
Mentor
Hi there,

Is their a way I can customise the Foreground & Background pens for a fill, to customise a symbol appearance with the use of Fragment2 ??

PS: I have already seen this thread https://Archicad-talk.Graphisoft.com/viewtopic.php?t=32287 and it is not suitable for my use case

Thanks in advance
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Nader Belal
Mentor
I´m marking this thread as solved, although it's unsolved since you can't really control Fills Foreground and Background pens with Fragment2 directly

So you either script the fills, or use elaborate methods (with varying degrees of success)
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

View solution in original post

3 REPLIES 3
Laszlo Nagy
Community Admin
Community Admin
This is what the GDL Reference Guide says about the FRAGMENT2 command:
FRAGMENT2
FRAGMENT2 fragment_index, use_current_attributes_flag
FRAGMENT2 ALL, use_current_attributes_flag
The fragment with the given index is inserted into the 2D Full View with the current transformations. If ALL is specified, all fragments are inserted.
use_current_attributes_flag: defines whether or not the current attributes will be used.
0: the fragment appears with the color, line type and fill type defined for it,
1: the current settings of the script are used instead of the color, line type and fill type of the fragment.


For example, you want to display the 2D geometry placed on Layer "3" of the 2D Symbol. You would use the following script:

FRAGMENT2 3, 1

The "1" used is what is important here, because it means that if you set the Pen, Line Type, and Fill Type using the PEN, LINE_TYPE, and FILL_TYPE commands, respectively, in your 2D Script before invoking this command, then the Fill will be displayed using the Pen, Line Type, and Fill Type you set in your 2D Script instead of the Pen, Line Type and Fill Type it is drawn using in the 2D Symbol. You can also create GDL parameters for the Pen, Line Type, and Fill Type, and the PEN, LINE_TYPE, and FILL_TYPE commands can use those parameters instead of attribute index numbers.

If the code goes like this:

FRAGMENT2 3, 0

then the 2D geometry will be displayed the same way you see it in the 2D Symbol Window.

I have not tried this just now, but based on the Guide, I think this is how it is supposed to work.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Nader Belal
Mentor
@LaszloNagy

Thank you for the quick reply.

What I was aiming is to be capable to change fills' pens (foreground and background) if I wanted to use Fragment2, without any other auxiliary 2D script to redraw the fill's area.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Solution
Nader Belal
Mentor
I´m marking this thread as solved, although it's unsolved since you can't really control Fills Foreground and Background pens with Fragment2 directly

So you either script the fills, or use elaborate methods (with varying degrees of success)
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!