We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Custom materials usage and import

kency
Enthusiast

Hello all,

 

How can we import a custom material /texture for walls and use the custom material through Add-On code? Is it possible to simply provide the URL of the texture?

Update -> Have added a screen shot of the custom image import for materials that I mentioned above.

 

kency_0-1699357394889.png

kency_1-1699357419678.png

 

Thank you,

Kency

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
Viktor Kovacs
Graphisoft
Graphisoft

You can do it with the API, but you need to implement a couple of steps to achieve the final result:

  1. Move the texture file to the embedded library (url reference doesn't work).
  2. Create a Surface attribute that references the texture file from the embedded library.
  3. Apply the created Surface attribute on the corresponding parameter of the wall.

View solution in original post

Solution
Viktor Kovacs
Graphisoft
Graphisoft

No out of the box solution, but you may check these example add-ons in the Development Kit:

  • In the LibPart_Test example add-on there is an example for retrieving the physical location of the embedded library. You just need to copy your texture file into this location. A library reload may be needed.
  • In the Attribute_Test example you can find codes to create attributes. There is no example for creating surfaces, but it's very similar to other attributes.
  • In the Element_Test example there are a lot of codes as an example for modifying elements.

View solution in original post

3 REPLIES 3
Solution
Viktor Kovacs
Graphisoft
Graphisoft

You can do it with the API, but you need to implement a couple of steps to achieve the final result:

  1. Move the texture file to the embedded library (url reference doesn't work).
  2. Create a Surface attribute that references the texture file from the embedded library.
  3. Apply the created Surface attribute on the corresponding parameter of the wall.
kency
Enthusiast

Thank you @Viktor Kovacs .

1. Is there any folder within the downloaded ArchiCAD application? Or the only way to import is through the ArchiCAD UI? 

2 and 3. Any example that you know of is available for the same in the DevKit?

Solution
Viktor Kovacs
Graphisoft
Graphisoft

No out of the box solution, but you may check these example add-ons in the Development Kit:

  • In the LibPart_Test example add-on there is an example for retrieving the physical location of the embedded library. You just need to copy your texture file into this location. A library reload may be needed.
  • In the Attribute_Test example you can find codes to create attributes. There is no example for creating surfaces, but it's very similar to other attributes.
  • In the Element_Test example there are a lot of codes as an example for modifying elements.