Solved! Go to Solution.
n.mihaylov wrote:In reply to your questions:
I have to create an element for it and I want to ask the following:
1. Do I have to use ACAPI_Element_Create or some API_LibPart function?
2. In the first case, is this the correct ID - element.header.typeID = API_ObjectID?
3. Do I have to set in the memo the coordinates and sizes of all the "lines" which build this figure? If I already have them imported, can I retrieve them in some way?
API_Element element; BNZeroMemory (&element, sizeof (API_Element)); element.header.typeID = API_ObjectID; API_ElementMemo elementMemo; BNZeroMemory (&elementMemo, sizeof (API_ElementMemo)); ACAPI_Element_GetDefaults (&element, &elementMemo); element.object.libInd = libIndex; element.object.pos.x = 3; element.object.pos.y = 0; element.object.level = 0; ACAPI_Element_Create (&element, &elementMemo); ACAPI_DisposeElemMemoHdls (&elementMemo);
n.mihaylov wrote:It could become confusing if you use the wrong terminology. That code you quoted gives you the definition of a
I found how to get the element:API_LibPart libPart; BNZeroMemory (&libPart, sizeof (API_LibPart)); libPart.index = element.object.libInd; ACAPI_LibPart_Get (&libPart);
n.mihaylov wrote:Ok, that makes sense as long as the details you are interested in are defined by the library part and can't be overridden by the instance element. For example, the parameter values should be extracted from the element, not the library part (unless you want the defaults).
Yes, I need to get details for my element and so I need the details for its Library Part.