2021-04-28 10:07 PM - last edited on 2021-09-14 09:39 AM by Noemi Balogh
Solved! Go to Solution.
2021-05-19 03:59 PM
Konstantin wrote:In Section or Elevation windows there are no doors and windows, you can see only section elements instead (type is API_SectElemID). The parent of the section elements are the doors/windows/etc., see this code:
In my plugin I get doors :GS::Array<API_Guid> elementList; ACAPI_Element_GetElemList(API_DoorID, &elementList, APIFilt_OnVisLayer);In 3D window view or Ground Floor I successfully getting the data list, but in Elevations my doors list is empty.
How can I get data in Elevations windows or other(Worksheets/Welcome ...)? Can I somehow get a document and get all the information I need from it, for example, a door?
static GS::Array<API_Guid> GetElemListByTypeFromSectionElevation (API_ElemTypeID elemTypeId) { GS::Array<API_Guid> result; GS::Array<API_Guid> sectElemList; ACAPI_Element_GetElemList (API_SectElemID, §ElemList, APIFilt_OnVisLayer); for (const API_Guid& sectElemGuid : sectElemList) { API_Element elem = {}; elem.header.guid = sectElemGuid; ACAPI_Element_Get (&elem); if (elem.sectElem.parentID == elemTypeId) { result.Push (elem.sectElem.parentGuid); } } return result; } // Usage API_WindowInfo currWindowInfo = {}; ACAPI_Database (APIDb_GetCurrentWindowID, &currWindowInfo); static const GS::HashSet<API_WindowTypeID> sectElemOnlyWindows = { APIWind_SectionID, APIWind_ElevationID, APIWind_InteriorElevationID }; GS::Array<API_Guid> elementList; if (sectElemOnlyWindows.Contains (currWindowInfo.typeID)) { elementList = GetElemListByTypeFromSectionElevation (API_DoorID); } else { ACAPI_Element_GetElemList (API_DoorID, &elementList, APIFilt_OnVisLayer); }
2021-04-29 02:49 PM
'STR#' ID_ADDON_MENU "Strings for the Menu" { /* [ 1] */ "Example AddOn Command... ^E3 ^ES ^EE ^EI ^ED ^ET ^10001" }You can check the complete list here:
2021-04-29 06:06 PM
Viktor wrote:Thanks a lot, it really works. But now I have a new question.
You can specify in the grc file where your command will be available. The magically looking tokens (E3, ES, etc.) are for this purpose.
'STR#' ID_ADDON_MENU "Strings for the Menu" { /* [ 1] */ "Example AddOn Command... ^E3 ^ES ^EE ^EI ^ED ^ET ^10001" }You can check the complete list here:
http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/APIDevKit51/APIHTMLLibra...
GS::Array<API_Guid> elementList; ACAPI_Element_GetElemList(API_DoorID, &elementList, APIFilt_OnVisLayer);In resources, I used "^ES^EE^EI^ED^EW^E3^EL" and I can call my plugin. In 3D window view or Ground Floor I successfully getting the data list, but in Elevations my doors list is empty.
2021-04-29 07:44 PM
2021-05-19 03:59 PM
Konstantin wrote:In Section or Elevation windows there are no doors and windows, you can see only section elements instead (type is API_SectElemID). The parent of the section elements are the doors/windows/etc., see this code:
In my plugin I get doors :GS::Array<API_Guid> elementList; ACAPI_Element_GetElemList(API_DoorID, &elementList, APIFilt_OnVisLayer);In 3D window view or Ground Floor I successfully getting the data list, but in Elevations my doors list is empty.
How can I get data in Elevations windows or other(Worksheets/Welcome ...)? Can I somehow get a document and get all the information I need from it, for example, a door?
static GS::Array<API_Guid> GetElemListByTypeFromSectionElevation (API_ElemTypeID elemTypeId) { GS::Array<API_Guid> result; GS::Array<API_Guid> sectElemList; ACAPI_Element_GetElemList (API_SectElemID, §ElemList, APIFilt_OnVisLayer); for (const API_Guid& sectElemGuid : sectElemList) { API_Element elem = {}; elem.header.guid = sectElemGuid; ACAPI_Element_Get (&elem); if (elem.sectElem.parentID == elemTypeId) { result.Push (elem.sectElem.parentGuid); } } return result; } // Usage API_WindowInfo currWindowInfo = {}; ACAPI_Database (APIDb_GetCurrentWindowID, &currWindowInfo); static const GS::HashSet<API_WindowTypeID> sectElemOnlyWindows = { APIWind_SectionID, APIWind_ElevationID, APIWind_InteriorElevationID }; GS::Array<API_Guid> elementList; if (sectElemOnlyWindows.Contains (currWindowInfo.typeID)) { elementList = GetElemListByTypeFromSectionElevation (API_DoorID); } else { ACAPI_Element_GetElemList (API_DoorID, &elementList, APIFilt_OnVisLayer); }