How to add and apply an .lcf file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-02
02:52 PM
- last edited on
‎2022-10-04
04:46 PM
by
Daniel Kassai

Does anybody know how can I add and "Reload & Apply" an .lcf file?
I looked through all API functions and did not find any. In the Library Manager I saw that the default Archicad Library 22 has a corresponding file Archicad Library 22.lcf and it is located in C:\Program Files\Graphisoft\Archicad 22\ . Should I copy my .lcf file there as well and then with some API function add and apply it?
Solved! Go to Solution.
- Labels:
-
Add-On (C++)
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-02 08:49 PM
GS::Array<API_LibraryInfo> libInfo; if (ACAPI_Environment (APIEnv_GetLibrariesID, &libInfo) == NoError) { API_LibraryInfo li; li.location = IO::Location ("<path to the lcf file>"); libInfo.Push (li); ACAPI_Environment (APIEnv_SetLibrariesID, &libInfo); }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-02 08:49 PM
GS::Array<API_LibraryInfo> libInfo; if (ACAPI_Environment (APIEnv_GetLibrariesID, &libInfo) == NoError) { API_LibraryInfo li; li.location = IO::Location ("<path to the lcf file>"); libInfo.Push (li); ACAPI_Environment (APIEnv_SetLibrariesID, &libInfo); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-03 10:25 AM
Thank you very much, Tibor!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-10 01:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-10 04:38 PM
n.mihaylov wrote:Properties are available for certain Classifications. So if a Property Definition is available for a Classification then all elements with the given Classification will have the specified Property.
And is it possible to create a new property group (ACAPI_Property_CreatePropertyGroup) with properties for an object that I added with the .lcf file or they should be included in the .lcf file?
So of course you can add new Property Groups and new Property Definitions, just make sure to set the 'availability' member of the Property Definitions to the same as your objects' Classification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-11 09:57 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-17 05:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-17 08:13 PM
n.mihaylov wrote:An .lcf file doesn't contain elements. It contains library parts (or objects) that describe what will happen if an element is created of that type, e.g. how it will be rendered in 2D or 3D. So you only have an element with a guid when you place an instance of a library part in the project.
Maybe a last question: what is the proper way to obtain the guid of the element that I imported from the .lcf file (in order to set its properties)?
If the element is created with the appropriate classification(s), it will automatically bind to the associated properties. I hope that makes sense.
Which functions were you hoping to call with the element guid?
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-18 09:19 AM
When I create an element and add a new property group with properties for it, for example a wall, it is immediately placed and has these properties (names and values) - this is the current instance. When I draw another wall (new instance) - it also has this property group but the properties have no values and I have to use Pick Up/Inject Parameters from the instance I created with my addon.
If this is the normal flow, then when I import a library object and add properties for its classification (in my case Building Element Proxy but I have to find a way to get it automatically), the object is not placed immediately and when I place an instance of it I will have the properties with no values again, like in the case of a wall, right?
I hoped ACAPI_Element_SetProperties would set the "properties" to the element with "elemGuid".
P.S. The colleague who wrote this addon left before I came and now I am trying to understand what he has done in order to implement the new things that I am asked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-01-18 09:54 AM
n.mihaylov wrote:It's not true that those properties won't have value! Those properties will have the default value of the property.
When I draw another wall (new instance) - it also has this property group but the properties have no values and I have to use Pick Up/Inject Parameters from the instance I created with my addon.
You can set default value for a property definition and also you can set the default property values for walls in the Wall Default settings.
n.mihaylov wrote:It's right.
If this is the normal flow, then when I import a library object and add properties for its classification (in my case Building Element Proxy but I have to find a way to get it automatically), the object is not placed immediately and when I place an instance of it I will have the properties with no values again, like in the case of a wall, right?
n.mihaylov wrote:Yes, that's right. You can use that function to set properties of an element instance (already placed).
I hoped ACAPI_Element_SetProperties would set the "properties" to the element with "elemGuid".
So for example if your placed wall instance has two properties 'PropA' and 'PropB' then you can set the values of those, BUT this function will return error code (APIERR_BADPROPERTYFORELEM) if you tried to set property with name 'PropX', because the wall instance does not have that property.
You can use ACAPI_ElementList_AddProperty function to make a property available for given elements. So if the given property is not exists for the element, then it will be created by this function (by making the property available for the element's classification).