cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Define Image Fill HELP!?

JGoode
Expert
Hi, I need to script an image fill into my object but I am not sure how to use the define image fill code. Any examples would be very helpful!

Thanks
ArchiCAD 23

Windows 10
13 REPLIES 13
Barry Kelly
Moderator
I have removed you other post asking basically the same thing.
I don't have a working example for you at the moment.
If I get a few moment later tonight I will see if I can help - unless someone else has an example in the mean time.

I would just copy and paste the command from the GDL manual and fill in all the variables.
I see it shows "part1, part2, ... etc" where in the other fill commands it shows "pat1, pat2, ... etc" or "pattern1, pattern2, ... etc" .
This I assume is just a typo - it is the bitmap pattern for the fill - nothing like consistency in the examples to avoid confusion.

8 positions for a dot in each of the 8 lines for the bitmap pattern.
Add these figures for each dot you want on (zero is off).
So a solid line would be ...
128+64+32+16+8+4+2+1 = 255

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
JGoode
Expert
Barry wrote:

8 positions for a dot in each of the 8 lines for the bitmap pattern.
Add these figures for each dot you want on (zero is off).
So a solid line would be ...
128+64+32+16+8+4+2+1 = 255
Thanks for the reply. What my goal is, is to use my 1x1 pixel to cover the entire fill space. I am not sure how manipulate those numbers to make the fill completely solid... any ideas?

Thanks
ArchiCAD 23

Windows 10
Barry Kelly
Moderator
So you have an image file that is 1x1 pixel?
Why do you want an image fill for that - it will just be a single colour?

Those numbers (pattern) are for the bitmap fill that you will only see if you turn the vectorial fills off.
I think it may also be the icon you will see in the fills dialogue - but I am not sure about that.
If you look at the example for the DEFINE FILLA command you should see what I mean.
The bitmap fill is a very basic 8x8 pixel representation of the vectorial fill.
If you want that to be solid it would be 255,255,255,255,255,255,255,255
8 x solid lines.

But this bitmap fill will not affect your image fill.

With an image fill you do not have a vectorial fill because you have an image (picture) instead.

I just gave it a quick try but I am not getting the image.
It is creating the fill and it even appears in my fill list as an image fill - but no image.
I will see if I can suss it out tonight.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Erwin Edel
Rockstar
The image needs to be in your (embedded?) library for it to load, I think.

I suppose if you want exact RGB value for a fill, this is an interesting approach.

Zones can have any RGB value as a fill, but if you explode these and drag them into 2D script, you just get some funky pennumber that it doesn't recognise.

I used a similar trick for a while for 'true' RAL colours to export properly to some other software by having 1x1 pixel textures in the surface settings. Using the RGB values resulted in them changing to something else related to all the other parameters. A bit back though, haven't been exporting much since cinerender got added in.

If you keep struggling, it is quite easy to set up a graphic override for a specific fill to an image fill. You could just make some specific vectorial fill and swap it out with your desired image fill that way for a single project.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
Barry Kelly
Moderator
Sorry I am not having much luck with any defined fills (image or vectorial).
They are all just coming out as black (pen 1) fills.
As far as I know this code should work for an image fill.
DEFINE IMAGE_FILL "test" "Flowers.jpg",
255, 255, 255, 255, 255, 255, 255, 255,
0.321, 0.485, 0, 0
Substitute the image name for one you have in your loaded or embedded library.

At work this image fill was showing up in my list of fills, but here at home it is not.
I don't know why this would be like this.
If I get a chance at work tomorrow I will give it another try.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
JGoode
Expert
Barry wrote:
Sorry I am not having much luck with any defined fills (image or vectorial).
They are all just coming out as black (pen 1) fills.
As far as I know this code should work for an image fill.
DEFINE IMAGE_FILL "test" "Flowers.jpg",
255, 255, 255, 255, 255, 255, 255, 255,
0.321, 0.485, 0, 0

Barry.
Thank you very much for your help! Finally got it working correctly!
ArchiCAD 23

Windows 10
Barry Kelly
Moderator
It is best to define these image fills in a MASTER_GDL object.
This way they will be created when the library loads and will be available as a regular fill wherever you can use fills.
It's name will be in italics in the material dialogue and attribute manager so you know it is defined via GDL.

Defining it in an object doesn't seem to work with image fills - at least for me.
I need to open the fills dialogue, select that image fill and press OK.
It then shows in plan but will go blank again after a re-build.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
JGoode
Expert
Barry wrote:
It is best to define these image fills in a MASTER_GDL object.
This way they will be created when the library loads and will be available as a regular fill wherever you can use fills.
It's name will be in italics in the material dialogue and attribute manager so you know it is defined via GDL.

Defining it in an object doesn't seem to work with image fills - at least for me.
I need to open the fills dialogue, select that image fill and press OK.
It then shows in plan but will go blank again after a re-build.

Barry.
Okay so it works when I place it...however in the preview it shows white dashed horizontal lines which are only visible in the object selection. This may not seem like a problem but it could potentially confuse the user so i'd like to get rid of it.

Here is a piece of example script;

fill "pink"
poly2_b{5} 12, 3, 0, 3, 60, 0,
0, 0, 1, 0, 0, 1, 0,
0.003, 0.005999992562067, 1,
0.008, 0.005999992562067, 900,
0, 180, 4001,
0.008, 0.005999992562067, 900,
0, 180, 4001,
0.003, 0.005999992562067, -1,
0.0125, 0.005999992562067, 1,
0.008, 0.005999992562067, 900,
0, -180, 4001,
0.008, 0.005999992562067, 900,
0, -180, 4001,
0.0125, 0.005999992562067, -1
ArchiCAD 23

Windows 10
JGoode
Expert
Even though my 2D image doesn't show it, the preview still shows strange patterns at 255. All I want is a solid fill. Any idea what numbers to use?
ArchiCAD 23

Windows 10