SOLVED!
Curtain wall coordinates
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-19 02:42 PM - last edited on 2022-10-05 01:31 PM by Daniel Kassai
2018-11-19
02:42 PM
Hello Archicad forum,
What would be the easiest way to get the corner position coordinates of a curtain wall. For a normal wall I use begC and endC and the width to determine the 4 corner coordinates of a vertical wall. However, I could not determine those coordinates for curtain wall. Neither segmentData, cornerFrameData nor boundaryFrameData of API_CurtainWallType let me retrieve any information (x and y is always 0.0). I have the suspicion it is more complicated since a curtain wall comprises multiple elements.
Thanks,
- Dan
What would be the easiest way to get the corner position coordinates of a curtain wall. For a normal wall I use begC and endC and the width to determine the 4 corner coordinates of a vertical wall. However, I could not determine those coordinates for curtain wall. Neither segmentData, cornerFrameData nor boundaryFrameData of API_CurtainWallType let me retrieve any information (x and y is always 0.0). I have the suspicion it is more complicated since a curtain wall comprises multiple elements.
Thanks,
- Dan
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
2018-11-19 04:12 PM
2018-11-19
04:12 PM
Hi Dan,
Curtain Wall is a composite element so it contains multiple subelements (segments, frames, panels, accessories and junctions). You can retrieve the subelements of a curtain wall by calling the ACAPI_Element_GetMemo function.
For example the curtain wall on the picture below has 3 segments (I marked them with red lines) and the beginning and end points of the segments are marked with red crosses.
Use this code to get the begC and endC of the segments:
dan wrote:The segmentData, cornerFrameData and boundaryFrameData members of API_CurtainWallType contain the default settings of the segments, corner frames and boundary frames. That's why those members do not contain any geometry informations.
Neither segmentData, cornerFrameData nor boundaryFrameData of API_CurtainWallType let me retrieve any information (x and y is always 0.0).
Curtain Wall is a composite element so it contains multiple subelements (segments, frames, panels, accessories and junctions). You can retrieve the subelements of a curtain wall by calling the ACAPI_Element_GetMemo function.
For example the curtain wall on the picture below has 3 segments (I marked them with red lines) and the beginning and end points of the segments are marked with red crosses.
Use this code to get the begC and endC of the segments:
GS::Array<GS::Pair<API_Coord3D, API_Coord3D>> GetCurtainWallSegmentsCoords (const API_Guid& cwGuid) { GS::Array<GS::Pair<API_Coord3D, API_Coord3D>> result; API_Element element; BNZeroMemory (&element, sizeof (API_Element)); element.header.guid = cwGuid; GSErrCode err = ACAPI_Element_Get (&element); if (err == NoError) { API_ElementMemo memo; BNZeroMemory (&memo, sizeof (API_ElementMemo)); err = ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_CWallSegments); if (err == NoError && memo.cWallSegments != nullptr) { for (UIndex ii = 0; ii < element.curtainWall.nSegments; ++ii) { const API_CWSegmentType& segment = memo.cWallSegments[ii]; GS::Pair<API_Coord3D, API_Coord3D> coordPair (segment.begC, segment.endC); result.Push (coordPair); } } ACAPI_DisposeElemMemoHdls (&memo); } return result; }
4 REPLIES 4
Solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-19 04:12 PM
2018-11-19
04:12 PM
Hi Dan,
Curtain Wall is a composite element so it contains multiple subelements (segments, frames, panels, accessories and junctions). You can retrieve the subelements of a curtain wall by calling the ACAPI_Element_GetMemo function.
For example the curtain wall on the picture below has 3 segments (I marked them with red lines) and the beginning and end points of the segments are marked with red crosses.
Use this code to get the begC and endC of the segments:
dan wrote:The segmentData, cornerFrameData and boundaryFrameData members of API_CurtainWallType contain the default settings of the segments, corner frames and boundary frames. That's why those members do not contain any geometry informations.
Neither segmentData, cornerFrameData nor boundaryFrameData of API_CurtainWallType let me retrieve any information (x and y is always 0.0).
Curtain Wall is a composite element so it contains multiple subelements (segments, frames, panels, accessories and junctions). You can retrieve the subelements of a curtain wall by calling the ACAPI_Element_GetMemo function.
For example the curtain wall on the picture below has 3 segments (I marked them with red lines) and the beginning and end points of the segments are marked with red crosses.
Use this code to get the begC and endC of the segments:
GS::Array<GS::Pair<API_Coord3D, API_Coord3D>> GetCurtainWallSegmentsCoords (const API_Guid& cwGuid) { GS::Array<GS::Pair<API_Coord3D, API_Coord3D>> result; API_Element element; BNZeroMemory (&element, sizeof (API_Element)); element.header.guid = cwGuid; GSErrCode err = ACAPI_Element_Get (&element); if (err == NoError) { API_ElementMemo memo; BNZeroMemory (&memo, sizeof (API_ElementMemo)); err = ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_CWallSegments); if (err == NoError && memo.cWallSegments != nullptr) { for (UIndex ii = 0; ii < element.curtainWall.nSegments; ++ii) { const API_CWSegmentType& segment = memo.cWallSegments[ii]; GS::Pair<API_Coord3D, API_Coord3D> coordPair (segment.begC, segment.endC); result.Push (coordPair); } } ACAPI_DisposeElemMemoHdls (&memo); } return result; }
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-21 10:49 AM
2018-11-21
10:49 AM
Thanks! This works perfectly for my facade.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-12-13 11:55 AM
2018-12-13
11:55 AM
Please forgive me, I forget to dispose the memo handle in my code above.
ACAPI_DisposeElemMemoHdls (&memo);Without that line it causes memory leaks. I updated the code today.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-12-13 12:04 PM
2018-12-13
12:04 PM
Tibor wrote:Thanks Tibor, I have already added this memo dispose line after implementing some other memo code based on the examples, so I did not actively realize it was missing from your example
Please forgive me, I forget to dispose the memo handle in my code above.ACAPI_DisposeElemMemoHdls (&memo);Without that line it causes memory leaks. I updated the code today.