2008-12-03
04:01 PM
- last edited on
2023-08-04
02:49 PM
by
Doreena Deng
2008-12-03 05:05 PM
atila-diffusion wrote:I think you have been looking at the
I aim to write a plugin for archicad 12 which load an external Hotlinked Module and paste it on the scene, [...] I found the Module Data Manager module, I think that's what I need to use but I'm not sure. they speak about an exemple but it's not in the exemple folder of API v12. I found this exemple in the examples pack for archicad 7 but the API is very old and too many things have changed to build it.
2008-12-04 09:48 AM
2008-12-04 12:16 PM
atila-diffusion wrote:Sorry, I don't know the answer that. These functions are new with AC12 and I haven't had any need for them yet. Experiment a bit and let us know what you find. Someone like Akos could probably tell you more.
So, I have to fill the API_HotlinkNode structure with the 3 others and other parameters. But once the structure is filled, will the modul be pasted automatically to the scene?
2008-12-08 05:00 PM
BNZeroMemory (&myAPI_HotlinkNode, sizeof (myAPI_HotlinkNode));
//fill API_HotlinkUserData structure
myAPI_HotlinkNode.userData.dataVersion=1;
myAPI_HotlinkNode.userData.platformSign= GS::Act_Platform_Sign;
//define single story mode
myAPI_HotlinkNode.storyRangeType = APIHotlink_SingleStory;
//define file type
myAPI_HotlinkNode.type = APIHotlink_Module;
//define file to load
myAPI_HotlinkNode.sourceLocation = &location;
//define update date
myUpdateDate.year = 2008;
myUpdateDate.month = 12;
myUpdateDate.dayOfWeek = 4;
myUpdateDate.day = 4;
myUpdateDate.hour = 10;
myUpdateDate.minute = 0;
myUpdateDate.second = 0;
myUpdateDate.milliSecond = 0;
err = TIGetGSTime(&myUpdateDate,&myAPI_HotlinkNode.updateTime,TI_UTC_TIME);
if (err != NoError) {
sprintf_s (msgStr,sizeof(msgStr), "TIGetGSTime: %d ",(int) err);
ACAPI_WriteReport (msgStr, true);
return err;
}
//other parameters
myAPI_HotlinkNode.refFloorInd = ind;
-use this fonction :
ACAPI_Database (APIDb_CreateHotlinkNodeID,&myAPI_HotlinkNode,NULL,NULL);and i use this one :
ACAPI_Database (APIDb_CreateHotlinkNodeID,&myAPI_HotlinkNode,NULL,NULL);I think that's the good way, but the last one creates a "APIERR_GENERAL" error code, i think that's because I do not succeed to fill many parameters in the sturcture.
2008-12-08 05:13 PM
atila-diffusion wrote:Have you tried enclosing your code between
i continued to search for my issues and I found something which seems to be good :
- I fill this structure : API_HotlinkNode
(even if I do not succeed to fill many of parameters) :
and i use this one :ACAPI_Database (APIDb_CreateHotlinkNodeID,&myAPI_HotlinkNode,NULL,NULL);I think that's the good way, but the last one creates a "APIERR_GENERAL" error code, i think that's because I do not succeed to fill many parameters in the sturcture.
2008-12-09 09:34 AM
res = CHANSI2Unicode ("Module1", GS::CStringLen, myAPI_HotlinkNode.name,API_UniLongNameLen, CC_Default, NULL);
res = CHANSI2Unicode ("1", GS::CStringLen, myAPI_HotlinkNode.refFloorName,API_UniLongNameLen, CC_Default, NULL);
myAPI_HotlinkNode.ownerId = 1295081318;
But i'm not sure at all.
2008-12-09 12:16 PM
atila-diffusion wrote:I haven't made any use of these functions yet, and the documentation is a bit thin. I think the best option is to PM Akos Somorjai - he is the API guru at GS, and has answered more than a few awkward questions for me.
yes, i already enclosed my code between these functions. I think this error comes from the fact i did not fill these three parameters in the structure: etc
2008-12-09 02:02 PM
2008-12-10 02:23 PM