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

Adding properties to Library Part

kolioi
Booster

Hello,

 

I am importing a .gsm file and create a library part for it. I tried to insert additional data in the parameters section, however some gsm files are password protected and I cannot access that section.

 

Is it possible to attach classification to the library part and add properties there? What is the best approach to add these additional properties to the library part?

 

Thanks in advance.

5 REPLIES 5
Bawar Tanay
Enthusiast

Yes, of course,

 

go to options --> property manager, if needed you should make a group or else make a parameter in one of the existing groups.

 

In the value definition you can specify the type of data, and default value

 

underneath, the availability for classifications is the most important.

This says which elements should have this parameter shown.

 

The quick and dirty way is too just say all, but that makes Archicad quite heavy as it has to load parameters for every single element in your project.

 

The better way to select on custom and click edit.

--> A popup will be opened asking which classification and which sub category the parameter have to have…

-->  in your project, you select the objects which you want to add more information.

--> you need to go to the classification and properties and turn on the specific classification and select the subcategory.

--> once that is done, you will automatically have the parameters underneath classifications (where the properties are shown) added.

--> and you can add the information you want.

 

Hopefully, this answers your question.

 

 

Archicad 16 - 26
Laptop: Alienware M18 R1 | windows 11 pro | i9-13900HX | RTX 4070 8 GB | 32 GB RAM
PC office 1: windows 11 pro | I7-10700 | RTX 2060 6 GB | 32 GB RAM
PC office 2: windows 11 pro | i7-12700 | RTX A2000 6GB | 32 GB RAM

Thanks a lot @Bawar Tanay for the comprehensive answer but I want to do that programmatically, in the plugin.

 

As far as I understand from the documentation, classifications apply to attributes and elements only, not to library parts. There are ACAPI_Element_ and ACAPI_Attribute_ sets of functions but nothing about library parts, is that correct?

Regarding the storage of the custom data, we can save it in a project data section (see ModulData Manager).

Not that I know much about API stuff but ...

 

Objects are elements, so ACAPI_Element should work there.

However, individual types of objects may be another matter.

They do have sub-types, maybe you can inquire those?

 

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

@Barry Kelly 

Yes, if we create an instance of the library part (i.e. element - door, window, chair, etc.) then we can attach classifications and properties to it.

This is what I want to do - create a library part and if the gsm file is not protected w/ a password, add the custom data in some section (add it in the parameters section or create new section). Then, when I open the Settings dialog I can see my data in Custom Settings. However, I can not do this if there is a password. So I am trying to find a workaround. I want to add classifications and properties to the library part but so far w/o any success. And here I need some help - at least I want to know if that is possible. However when I create an object (element) of that part I can easily add properties to it.

I wouldn't have thought a password protected object would stop you applying classifications and properties as they have nothing to do with the GDL scripts.

Classification is added based on the default setting of the tool as you place the element, and properties are added based on the classification set.

I have no idea if you can control that with an API before you place the object.

 

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