We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-07-08 08:49 AM - last edited on 2024-09-18 03:41 PM by Doreena Deng
Hello,
Have someone come across a use to set the height of an Object from code. Have added the screenshot of the field which I meant .
There are fields in API_ObjectType for setting the X and Y values but not for the height.
Solved! Go to Solution.
2024-07-08 12:35 PM
No you don't have to edit the library object itself. You have to change the parameters value for a specific object (which has reference to the relevant library object). The parameters for a specific object are part of the Element Memo of that object.
This way you can change single instances.
2024-07-08 12:55 PM
It depends on what you want to achieve. Editing the library part is rarely needed. Usually placed instances need to be updated.
You can use the ACAPI_Element_Get and ACAPI_Element_GetMemo functions to retrieve parameters.
In the API_ElementMemo structure there is the "params" array, that need to be updated.
If you install the devkit there should be an examples folder which uses these structures quite a lot. There is the Element_Test sample, and for example the Element_Modify_ChangeParameters.cpp in the project. There you can find ways to iterate through the parameters of an object instance.
2024-07-08 11:02 AM
Hi Kency, I think you need to change the ZZYZX parameter of the object. But don't have time to confirm right now.
2024-07-08 11:19 AM
Yep A, B, ZZYZX sets the dimensions of an object. ZZYZX is the height.
(But in case of a door for example A, B defines the hole in the wall.)
2024-07-08 12:23 PM
To edit the ZZYZX value, we would need to update the library object right? Will editing that affect the all the object instances or just a single instance?
2024-07-08 12:35 PM
No you don't have to edit the library object itself. You have to change the parameters value for a specific object (which has reference to the relevant library object). The parameters for a specific object are part of the Element Memo of that object.
This way you can change single instances.
2024-07-08 12:55 PM
It depends on what you want to achieve. Editing the library part is rarely needed. Usually placed instances need to be updated.
You can use the ACAPI_Element_Get and ACAPI_Element_GetMemo functions to retrieve parameters.
In the API_ElementMemo structure there is the "params" array, that need to be updated.
If you install the devkit there should be an examples folder which uses these structures quite a lot. There is the Element_Test sample, and for example the Element_Modify_ChangeParameters.cpp in the project. There you can find ways to iterate through the parameters of an object instance.
2024-07-09 09:08 AM
Thank you this worked.