cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Streamline your workflows and master BIM coordination! Program starts April 28!

GDL
About building parametric objects with GDL.
SOLVED!

View Image on 2D Views

Le Tan Kien
Contributor

Hello everyone,

I hope you're doing well! I’m working on a project in Archicad, and I want to create a table with an image (PNG, JPG, etc.) inside one of the table cells. I also need the image to be visible in the 2D view. How can I achieve this?
The code that I have tried: 

table_width = 300
table_height = 200

rect2 0, 0, table_width, table_height   
line2 0, 100, table_width, 100          
line2 100, 0, 100, table_height        

DEFINE STYLE "BigText" "Arial", 20, 5  
SET STYLE "BigText"                   

text2 10, 180, "Tên Sản Phẩm"
text2 120, 180, "Mô tả"
PICTURE "Matsau.jpg", 10, 10, 100, 100
 

Thank you in advance for your help!


image.png

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

You still have the picture command wrong.

Try ... PICTURE2 name, x, y, mask

 

PICTURE2 "Matsau.jpg", 10, 10, 1

 

I think the image needs to be in the embedded library as I can't seem to add an image in my loaded library.

 

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

View solution in original post

6 REPLIES 6
Barry Kelly
Moderator

In 2D script you will need PICTURE2 or PICTURE2{2}.

 

PICTURE on its own is for the 3D script.

 

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

Thank you, Mr. Barry,
I have tried it but still cannot see the image. I have placed it into the Embedded Library, but it still doesn't work. Could you please assist me further?

 

LeTanKien_0-1743669055847.png

 

image.png

Solution

You still have the picture command wrong.

Try ... PICTURE2 name, x, y, mask

 

PICTURE2 "Matsau.jpg", 10, 10, 1

 

I think the image needs to be in the embedded library as I can't seem to add an image in my loaded library.

 

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

Thank you sir

You still have the command wrong.

it is in the format name, x-size, y-size, mask.

 

PICTURE2 "demo.png", 10, 10, 1

 

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

Thank you sir, It's done