Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Change/modify dimension

ReignBough
Booster
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 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS
1 REPLY 1

ReignBough
Booster
UPDATE

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 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!