Looking for API function definition
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-08
03:01 PM
- last edited on
2022-10-05
01:30 PM
by
Daniel Kassai
2018-11-08
03:01 PM
Hi guys,
How can I find, if possible, the definition of ACAPI_Property_CreatePropertyDefinition? I modified Element_Test example to have a menu command to open a text file and import the settings but I got a crash in this function
How can I find, if possible, the definition of ACAPI_Property_CreatePropertyDefinition? I modified Element_Test example to have a menu command to open a text file and import the settings but I got a crash in this function

Labels:
- Labels:
-
Add-On (C++)
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-08 03:32 PM
2018-11-08
03:32 PM
Hi,
Could you show me please the definition of your PropertyTestHelpers::CreateProperty function?
I think a little mistake in that function causes the crash.
The definitions of ACAPI functions are inside ARCHICAD, so they are not public.
Regards,
Tibor
Could you show me please the definition of your PropertyTestHelpers::CreateProperty function?
I think a little mistake in that function causes the crash.
The definitions of ACAPI functions are inside ARCHICAD, so they are not public.
Regards,
Tibor
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-08 03:37 PM
2018-11-08
03:37 PM
Here it is, and is working on Mac:
API_PropertyDefinition PropertyTestHelpers::CreateProperty (API_PropertyGroup group, const char * name)
{
API_PropertyDefinition definition;
definition.guid = APINULLGuid;
definition.groupGuid = group.guid;
GS::UniString uniName (name, CC_UTF8);
definition.name = uniName;
definition.description = "Custom property set by ArchiCADImporter";
definition.collectionType = API_PropertySingleCollectionType;
definition.valueType = API_PropertyStringValueType;
definition.defaultValue.singleVariant.variant.type = definition.valueType;
return definition;
}
API_PropertyDefinition PropertyTestHelpers::CreateProperty (API_PropertyGroup group, const char * name)
{
API_PropertyDefinition definition;
definition.guid = APINULLGuid;
definition.groupGuid = group.guid;
GS::UniString uniName (name, CC_UTF8);
definition.name = uniName;
definition.description = "Custom property set by ArchiCADImporter";
definition.collectionType = API_PropertySingleCollectionType;
definition.valueType = API_PropertyStringValueType;
definition.defaultValue.singleVariant.variant.type = definition.valueType;
return definition;
}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-08 06:22 PM
2018-11-08
06:22 PM
n.mihaylov wrote:Are you sure that the "name" string has UTF8 encoding?
GS::UniString uniName (name, CC_UTF8);
definition.name = uniName;
Could you replace these two lines with the following one line and retry it please?
definition.name = name;
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-09 08:46 AM
2018-11-09
08:46 AM
Thanks but no luck, the same crash
There is "something" different here between Win and Mac (it's working on Mac) and now I'll try to investigate.

There is "something" different here between Win and Mac (it's working on Mac) and now I'll try to investigate.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-12-05 10:02 AM
2018-12-05
10:02 AM
Hello,
Could you please provide some example strings, that are used as names for the Property Definitions?
I could not reproduce the same issue yet.
Best regards,
Dénes
Could you please provide some example strings, that are used as names for the Property Definitions?
I could not reproduce the same issue yet.
Best regards,
Dénes
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-02-07 08:09 AM
2019-02-07
08:09 AM
Hi,
I fixed the problem several lines further, where I was setting the availability, although the addon crashed "here".
I fixed the problem several lines further, where I was setting the availability, although the addon crashed "here".