‎2021-06-18
12:49 AM
- last edited on
‎2021-09-14
09:34 AM
by
Noemi Balogh
GSErrCode Do_CreateHotlink (void)
{
API_Guid hotlinkNodeGuid = APINULLGuid;
IO::Location sourceFileLoc("c:\\Users\\dell7559\\Desktop\\module.pln"); //my way of replacing the default pln file
API_HotlinkNode hotlinkNode;
BNZeroMemory (&hotlinkNode, sizeof (API_HotlinkNode));
hotlinkNode.type = APIHotlink_Module;
hotlinkNode.storyRangeType = APIHotlink_AllStories;
hotlinkNode.sourceLocation = &sourceFileLoc;
hotlinkNode.refFloorInd = 0;
GS::ucsncpy (hotlinkNode.name, L("Hotlink created by test add-on"), API_UniLongNameLen - 1);
GSErrCode err = ACAPI_Database (APIDb_CreateHotlinkNodeID, &hotlinkNode);
if (err == NoError) {
char guidStr[64];
hotlinkNodeGuid = hotlinkNode.guid;
APIGuid2GSGuid (hotlinkNodeGuid).ConvertToString (guidStr);
WriteReport ("Hotlink node is created successfully: {%s}", guidStr);
ACAPI_WriteReport(guidStr, true);
}
if (err == NoError && hotlinkNodeGuid != APINULLGuid) {
API_Element element; // place an instance of this hotlink
BNZeroMemory (&element, sizeof (API_Element));
element.header.typeID = API_HotlinkID;
element.header.layer = 1;
element.hotlink.hotlinkNodeGuid = hotlinkNodeGuid;
element.hotlink.type = APIHotlink_Module;
element.hotlink.transformation.tmx[3] = 10;
element.hotlink.transformation.tmx[7] = 4;
double co = cos (0.52359877556);
double si = sin (0.52359877556);
element.hotlink.transformation.tmx[0] = element.hotlink.transformation.tmx[5] = co;
element.hotlink.transformation.tmx[1] = -si;
element.hotlink.transformation.tmx[4] = si;
element.hotlink.ignoreTopFloorLinks = true;
element.hotlink.relinkWallOpenings = false;
element.hotlink.adjustLevelDiffs = false;
err = ACAPI_Element_Create (&element, nullptr);
if (err == NoError) {
char guidStr[64];
APIGuid2GSGuid (element.header.guid).ConvertToString (guidStr);
WriteReport ("Hotlink instance is created successfully: {%s}", guidStr);
}
}
return err;
} // Do_CreateHotlink
I'd really appreciate if anyone could point me into the right direction!‎2021-06-25 06:33 PM
GS::ucsncpy(hotlinkNode.name, L("Hotlink created by test add-on"), API_UniLongNameLen - 1);
Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol "__declspec(dllimport) unsigned short const * __cdecl GS::DefineConstantUTF16CharacterOrString(wchar_t const *)" (__imp_?DefineConstantUTF16CharacterOrString@GS@@YAPEBGPEB_W@Z) referenced in function "int __cdecl Do_CreateHotlink(class GS::UniString const &,double *)" (?Do_CreateHotlink@@YAHAEBVUniString@GS@@PEAN@Z) AddOn d:\programming\archicad\Hotlink Placer\Build\AddOnMain.obj 1 1>------ Build started: Project: AddOnResources, Configuration: Debug x64 ------ 2>------ Build started: Project: AddOn, Configuration: Debug x64 ------ 2>AddOnMain.cpp 2> Creating library D:/programming/archicad/Hotlink Placer/Build/Debug/Hotlink_Placer.lib and object D:/programming/archicad/Hotlink Placer/Build/Debug/Hotlink_Placer.exp 2>AddOnMain.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) unsigned short const * __cdecl GS::DefineConstantUTF16CharacterOrString(wchar_t const *)" (__imp_?DefineConstantUTF16CharacterOrString@GS@@YAPEBGPEB_W@Z) referenced in function "int __cdecl Do_CreateHotlink(class GS::UniString const &,double *)" (?Do_CreateHotlink@@YAHAEBVUniString@GS@@PEAN@Z) 2>D:\programming\archicad\Hotlink Placer\Build\Debug\Hotlink_Placer.apx : fatal error LNK1120: 1 unresolved externals 2>Done building project "AddOn.vcxproj" -- FAILED. ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
‎2021-07-20 07:39 AM