SOLVED!
Plugin\plugin button disabled in South Elevation/3D All/Action Center and other view
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-04-28
10:07 PM
- last edited on
ā2021-09-14
09:39 AM
by
Noemi Balogh
ā2021-04-28
10:07 PM
Hello everybody. I have a problem. My plugin/plugin button is disabled in South Elevation / 3D All / Action Center views, but everything works fine in the ground floor view. Tell me why this is happening?? Thx
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-05-19 03:59 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); }
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-04-29 02:49 PM
ā2021-04-29
02:49 PM
You can specify in the grc file where your command will be available. The magically looking tokens (E3, ES, etc.) are for this purpose.
http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/APIDevKit51/APIHTMLLibra...
'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:
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-04-29 06:06 PM
ā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...
In my plugin I get doors :
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.
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?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-04-29 07:44 PM
ā2021-04-29
07:44 PM
Archicad API commands are context sensitive. It means that you can't access the same data from every window. This is why usually it's a good idea to make commands work over floor plan only (some of the internal commands work this way, too).
When you are over a section window, you can access only the elements on that section. It is possible to switch to floor plan database, access the elements and switch back to the original database, but I don't recommend this workflow. If it's not a strong requirement to make it work over sections, it's a better choice to disable it.
When you are over a section window, you can access only the elements on that section. It is possible to switch to floor plan database, access the elements and switch back to the original database, but I don't recommend this workflow. If it's not a strong requirement to make it work over sections, it's a better choice to disable it.
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-05-19 03:59 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); }