Use of ACAPI_element_UnIdToGuid
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-10-28
07:59 AM
- last edited on
2023-08-03
10:53 AM
by
Doreena Deng
2010-10-28
07:59 AM
Hi,
I have a drawing in ArchiCAD 9.0, in which one element stores the ‘unId’ of other element as the parameter ‘parent_unId’. (That is the way we relate each other elements parent child relation ship).
In this scenario my parent element is door element and child is door extra element.
Now we are opening this drawing with ArchiCAD 13.0 I need to convert ‘parent_unid’ to API_Guid.
I am trying to use following function when I receive APINotify_ConvertUnId notification.
I am thinking problem in this function ACAPI_Database(APIDb_GetCurrentDatabaseID, &dbInfo, NULL);
Can any one please explain me what are the databases I have to look to convert unId to guid and how to use ACAPI_element_UnIdToGuid() function?
Ranga
I have a drawing in ArchiCAD 9.0, in which one element stores the ‘unId’ of other element as the parameter ‘parent_unId’. (That is the way we relate each other elements parent child relation ship).
In this scenario my parent element is door element and child is door extra element.
Now we are opening this drawing with ArchiCAD 13.0 I need to convert ‘parent_unid’ to API_Guid.
I am trying to use following function when I receive APINotify_ConvertUnId notification.
OSErr DOConvertUnId() { API_Element element; API_ElementMemo memo; API_DatabaseInfo dbInfo; API_Guid parentGuid = APINULLGuid; Int32 ii, num; SetDB(FLOORPLAN);//our function BNZeroMemory(&dbInfo, sizeof(API_DatabaseInfo)); if(ACAPI_Database(APIDb_GetCurrentDatabaseID, &dbInfo, NULL) == NoError) { ACAPI_Element_GetNum(API_ObjectID, &num); for(ii = 1; ii <= num; ii++) { if(ACAPI_Element_Filter_Index(API_ObjectID, ii, APIFilt_IsEditable)) { memset(&element, 0, sizeof(API_Element); element.header.typeID = API_ObjectID; element.header.index =ii; if(ACAPI_Element_Get(&element) == NoError && element.object.libInd == utLibIndStore->DoorExtraInd) { memset(&memo, 0, sizeof(API_elementMemo); if(ACAPI_Element_GetMemo(element.header.guid, &memo) == NoError) { parentGuid = ACAPI_element_UnIdToGuid(dbInfo.databaseUnId, (GS::Uint32) GetParamValue(memo.parms, “parent_unid”)); if(parentGuid != APINULLGuid) { char guidStr[64]; APIGuid2GSGuid(parentGuid).ConvertToString(guidStr); GiveMsg(guidStr); } } } } } } }This function giving the guid message but the guid it displays is of one of the wall (not the wall contained my door), not door.
I am thinking problem in this function ACAPI_Database(APIDb_GetCurrentDatabaseID, &dbInfo, NULL);
Can any one please explain me what are the databases I have to look to convert unId to guid and how to use ACAPI_element_UnIdToGuid() function?
Ranga
Labels:
- Labels:
-
Add-On (C++)
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-10-29 07:01 AM
2010-10-29
07:01 AM
Hi,
I haven't had any experience with this function yet, but I am guessing you should use API_DoorID instead of API_ObjectID.
Regards,
Hoa
I haven't had any experience with this function yet, but I am guessing you should use API_DoorID instead of API_ObjectID.
Regards,
Hoa
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-11-01 01:56 AM
2010-11-01
01:56 AM
Hi,
Thanking you for replay.
My child element (doorExtra) is an object, which stores the unId of door element. So, first I am getting my doorExtra then I am getting “parent_unid” and try to convert this into guid using this function.
Thanking you for replay.
My child element (doorExtra) is an object, which stores the unId of door element. So, first I am getting my doorExtra then I am getting “parent_unid” and try to convert this into guid using this function.
parentGuid = ACAPI_element_UnIdToGuid(dbInfo.databaseUnId, (GS::Uint32) GetParamValue(memo.parms, "parent_unid"));But I am getting guid of wall instead of door. ( if I open my drawing with ArchiCAD 9.0 “parent_unid” stored in the doorExtra object is unId of one of the door.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2010-11-05 05:02 AM
2010-11-05
05:02 AM
Please some one help me in this issue.