The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy, rmasaki

By n.mihaylov
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 :(

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.

By n.mihaylov
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); = 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;
n.mihaylov wrote:GS::UniString uniName (name, CC_UTF8); = uniName;
Are you sure that the "name" string has UTF8 encoding?
Could you replace these two lines with the following one line and retry it please?
Code: Select all = name;
User avatar
By dfintha

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,