2010-09-27
05:00 AM
- last edited on
2023-08-03
11:26 AM
by
Doreena Deng
static void DumpZoneQuantity(API_Element *element) { API_QuantityPar params; API_ZoneAllQuantity zone; BNZeroMemory(¶ms,sizeof(API_QuantityPar)); BNZeroMemory(&zone,sizeof(API_ZoneAllQuantity)); ACAPI_Element_GetQuantities(API_ZoneID,element->header.index,¶ms, &zone, NULL, NULL, NULL, NULL, NULL); char s[256] = { '\0' }; char output_string[1000] = ""; sprintf (s, "Room %d \nGuid is %s\n",element->header.index,APIGuid2GSGuid(element->header.guid).ToUniString().ToCStr()); strcat(output_string,s); sprintf (s, "The Height of room is %lf\n",zone.height); strcat(output_string,s); sprintf (s, "The Area is %lf\n",zone.area); strcat(output_string,s); sprintf (s, "Volume is %lf\n",zone.volume); strcat(output_string,s); sprintf (s, "Surface of Wall inside the room (not include windows, holes and doors is %lf\n",zone.wallsSurf); strcat(output_string,s); sprintf (s, "Surface of doors is %lf and total width of the doors is %lf\n",zone.doorsSurf,zone.doorsWidth); strcat(output_string,s); sprintf (s, "Surface of window is %lf and total width of window is %lf\n",zone.windowsSurf,zone.windowsWidth); strcat(output_string,s); WriteReport(output_string); } static void Do_SelectedGetValue() { API_SelectionInfo selectionInfo; API_Neig **selNeigs = NULL; ACAPI_Selection_Get (&selectionInfo, &selNeigs, false); if(selectionInfo.typeID == API_SelEmpty) //No selection so we loop through all zone in the floorplan { GS::Array<API_Guid> elemList; ACAPI_Element_GetElemList (API_ZoneID, &elemList); for (Int32 i = 0; i < (Int32)elemList.GetSize (); ++i) { API_Element element; BNZeroMemory (&element, sizeof (API_Element)); element.header.guid = elemList; if (ACAPI_Element_Get (&element) == NoError) { DumpZoneQuantity(&element); } } } else //If we have selection so we look at the zone, if no zone then print error { Int32 zone_count = 0; for (Int32 i = 0; i < selectionInfo.sel_nElem; i++) //Loop through selection { API_ElemTypeID typeID; typeID = Neig_To_ElemID ((*selNeigs).neigID); if (typeID == API_ZoneID) { zone_count++; API_Element element; BNZeroMemory(&element,sizeof(API_Element)); element.header.guid = (*selNeigs).guid; ACAPI_Element_Get (&element); DumpZoneQuantity(&element); } } if(zone_count == 0) { WriteReport("No zone selected"); } } }Code2 : WallPart from RoomRelation. This is the method that I use.
API_RoomRelation relData; ACAPI_Element_GetRelations ((*selNeigs)[0].guid,API_ZombieElemID,(void*) &relData); API_WallPart *part; part = *(relData.wallPart); //To use part[0],part[1] , ... , part[relData.nWallPart-1]Note : ((*selNeigs)[0] is the zone that I selected it.
2010-09-27 05:20 AM
2010-09-27 03:29 PM
Paodekcal wrote:
Another code it's can get "WallPart" from the zone. But It's not "Wall Guid". I want wall Guid because I want to get another value from the wall.
2010-09-28 05:05 AM
2010-09-28 11:02 AM
Paodekcal wrote:The polygon describing the room perimeter is stored in a
Can you tell me how API locate "roomedge" polygon index. Where is the first roomedge of the zone? In the right of the zone. Or start on the left. Clockwise or Counter-Clockwise.
2010-09-29 04:32 AM