2019-01-21 03:03 PM - last edited on 2022-10-04 04:42 PM by Daniel Kassai
Solved! Go to Solution.
2019-02-06 02:48 PM
2019-03-13 05:17 PM
2019-03-14 10:26 AM
n.mihaylov wrote:I think you want to look at what default values the element is inheriting when you use
When I import a new Library Object and then create an element of it and place it, some of the parameters are changed and the whole element is "broken". The object itself is imported with the correct parameters in the Library Manager - if I manually choose the object and place an instance, everything is OK, the parameters are correct. Only the element created by ACAPI_Element_Create in my addon has wrong parameters.
What could be the problem?
2019-03-14 01:48 PM
2019-03-14 02:39 PM
n.mihaylov wrote:I think ACAPI_Element_GetDefaults will simply extract all the settings from the specified tool settings dialog, including the memo with the parameter settings. The libInd you specify is ignored and overwritten with whatever object is currently selected in the settings dialog.
According to the example for ACAPI_Element_GetDefaults, I added a new line setting APIVarId_Object and also doubled the element.object.libInd setting but I keep on getting the default values of an object called Armchair 01 22 from the default library:
2019-03-14 04:59 PM
2019-03-15 09:15 AM
2019-03-15 10:11 AM
ACAPI_LibPart_GetParams (libPart.index, &aParam, &bParam, &addParNum, &elementMemo.params); element.object.libInd = libPart.index; element.object.pos.x = 3; element.object.pos.y = 0; element.object.level = 0; element.object.xRatio = aParam; element.object.yRatio = bParam; ACAPI_Element_Create (&element, &elementMemo); ACAPI_DisposeElemMemoHdls (&elementMemo);Now the element has the correct parameters.