Change/modify dimension
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-01-08
06:32 AM
- last edited on
2021-09-14
01:35 PM
by
Noemi Balogh
2021-01-08
06:32 AM
I've created a simple code that will read all the API_DimElem from memo then combine consecutive equidistant dimensions (dimVal). Then use ACAPI_Element_Change() to update the element but it returns API_BADPARS.
/***** code for creating newDimElems here *****/ // change/update element dimCnt = newDimElems.GetSize(); memo.dimElems = (API_DimElem**)BMAllocateHandle(sizeof(API_DimElem) * dimCnt, ALLOCATE_CLEAR, 0); for (UInt32 i = 0; i < dimCnt; ++i) (*memo.dimElems) = newDimElems; API_Element mask; ACAPI_ELEMENT_MASK_CLEAR(mask); ACAPI_ELEMENT_MASK_SET(mask, API_DimensionType, nDimElem); elem.dimension.nDimElem = dimCnt; err = ACAPI_Element_Change(&elem, &mask, &memo, APIMemoMask_All, true);Any idea where I go wrong?
~ReignBough~
ARCHICAD 27 INT (since AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
ARCHICAD 27 INT (since AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Labels:
- Labels:
-
Add-On (C++)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-01-11 11:04 AM
2021-01-11
11:04 AM
UPDATE
Instead of creating dimensions then changing it, I just process the coordinates before creating the dimension. (As before, combining equal consecutive "computed" dimVal.)
But the the generated dimension is not as expected.
Instead of creating dimensions then changing it, I just process the coordinates before creating the dimension. (As before, combining equal consecutive "computed" dimVal.)
Raw dimensions <-- dimension is not yet created base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (18.45889129, 30.99275442, 0.00000000) API_NoteContent_Measured 0.00000 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.12751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.40751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 --\ distance base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.68751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 | from base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.96751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 | previous base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (21.24751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 | dimElem base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (21.52751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 | is equal base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (21.80751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 | to 280 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.08751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 | (equidistant) base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.36751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 --/ base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.52751402, 29.79275442, 12.00000000) API_NoteContent_Measured 0.00000 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (23.72751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 Filtered dimensions (newDimElems) <-- dimension is not yet created, this is the above after being processed base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (18.45889129, 30.99275442, 0.00000000) API_NoteContent_Measured 0.00000 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.12751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.36751369, 30.99275442, 12.00000000) API_NoteContent_Custom <MeasuredValue> 8 EQ PARTS base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.52751402, 29.79275442, 12.00000000) API_NoteContent_Measured 0.00000 base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (23.72751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 Created dimensions base.loc3D (23.72751369, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 0.00000 base.loc3D (22.52751402, 29.79275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 1.20000 base.loc3D (22.36751369, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Custom 160 8 EQ PARTS base.loc3D (20.12751369, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 2.24000 base.loc3D (18.45889129, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 1.66862
But the the generated dimension is not as expected.
~ReignBough~
ARCHICAD 27 INT (since AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
ARCHICAD 27 INT (since AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS