API Module DATA Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-12-03
04:01 PM
- last edited on
2023-08-04
02:49 PM
by
Doreena Deng
I need help to use API developper kit.
I aim to write a plugin for archicad 12 which load an external Hotlinked Module and paste it on the scene, like if in Archicad we do : file -> External content -> Place hotlinked Module -> choose Hotlink (module file and select "open in single story mode") and place Module.
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.
So, if somebody could help me please i really need help because it's difficult to understand how to use this module.
Than you and sorry for my english, i do my best .
- Labels:
-
Add-On (C++)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
I haven't attempted to place hotlinks in a project, so I can't definitively say that it will work, but I recommend you look at the following subjects in the Devkit documentation:
- - API_HotlinkTypeID
- API_HotlinkStoryRangeID
- API_HotlinkUserData
- API_HotlinkNode
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-12-04 09:48 AM
you're right this subjects seems to be what I'm looking for.
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?
Thank you very much for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-12-08 05:00 PM
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) :
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.
If someone know where is my error, that would be the biggest Christmas present oh this year

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-12-09 09:34 AM
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:
GS::uchar_t name [API_UniLongNameLen];
GS::uchar_t refFloorName [API_UniLongNameLen];
GSType ownerId;
because I don't understand what are GS::uchar_t and GSType, so these parameters are important.
I tried this :
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-12-09 02:02 PM
i send him a PM, i'm waiting for his aswer.
I continue to search and I'll let you know what i find.
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-12-10 02:23 PM
I succeeded to solve my error, i just had to do this :
myAPI_HotlinkNode.refFloorInd = -2;
instead of this
myAPI_HotlinkNode.refFloorInd = 1;
Now my module is saved in archicad, i now have to place it.
i will succeed , i don't lose hope.