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

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

Getting / generating preview images of line types, fills, etc.

eptar
Contributor

Hi,

 

We need a preview image of such things like line types, fills, building materials (such a thing like in the composite editor where the preview of the composite can be seen). Is there a way to get such things anyhow through the API?

 

Our ideas (but we miss certain steps):

1) Structures in the QGDrawing folder looks alike the structures used in the API describing line types, fills, etc., but we did not find a lib file which contains the implementation. Is there a way to get a lib file for the QGDrawing headers? It seems we could use this to solve some of our issues regarding the preview images, if we could build the solution, but linking fails.

2) We might be able to solve some of our topics if we could transform a VectorImage to a GX::Image, but so far we had no success to achieve it. Does anyone have any experience with it?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Viktor Kovacs
Graphisoft
Graphisoft

There are two examples in DG_Test example Add-On that can help you with this.

 

Example 1: DG_Test AddOn, BuildingMaterialDialog.cpp

It calls the SetTabFieldOwnerDrawFlag on a ListBox so the ListBoxTabFieldUpdate function will be called and you can draw whatever you want. Check the UpdateBuildingMatDrawTab and DrawBuildingMaterial function to see how to use actual pens and fills.

ViktorKovacs_0-1717477428733.png

 

Example 2: DG_Test AddOn, UserItemDialog.cpp

This example uses a DG::UserItem that you can draw to. Check the UserItemUpdate function to see how it works. Combined with the previous example I think you can achieve your goal of drawing attribute previews to any dialogs.

ViktorKovacs_1-1717477490276.png

 

View solution in original post

2 REPLIES 2
Solution
Viktor Kovacs
Graphisoft
Graphisoft

There are two examples in DG_Test example Add-On that can help you with this.

 

Example 1: DG_Test AddOn, BuildingMaterialDialog.cpp

It calls the SetTabFieldOwnerDrawFlag on a ListBox so the ListBoxTabFieldUpdate function will be called and you can draw whatever you want. Check the UpdateBuildingMatDrawTab and DrawBuildingMaterial function to see how to use actual pens and fills.

ViktorKovacs_0-1717477428733.png

 

Example 2: DG_Test AddOn, UserItemDialog.cpp

This example uses a DG::UserItem that you can draw to. Check the UserItemUpdate function to see how it works. Combined with the previous example I think you can achieve your goal of drawing attribute previews to any dialogs.

ViktorKovacs_1-1717477490276.png

 

Thanks, it seems to solve our issues around the topic.