BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.

Use gravity for Z position

Miha Nahtigal
Advocate
My Addon creates API_Element (GDL object) on user specified coordinates acquired with APIIo_GetPointID. X and Y coordinates are ok, Z coordinate is always zero.

I would like to use gravity when picking a point on eg Mesh so Z coordinate gets populated too.

Is this possible?
BIMquants.comBETA - Quantities and Costs Estimation with Archicad AddOn :: rushing to publish a beta preview
3 REPLIES 3
Miha Nahtigal
Advocate
Talking to myself a bit more...

I could use TDGetHeightAtPoint() which will "Calculate the height of a triangulated mesh at a given location."

Unfortunately one of the parameters is a list of triangles. Browsing through mesh type and its memo, I do not think I can extract them from specified existing mesh.

To go a bit further... there is also a TDTriangulate() function. Wouldn't be a bit overkill using it on already defined (and triangulated) mesh?
BIMquants.comBETA - Quantities and Costs Estimation with Archicad AddOn :: rushing to publish a beta preview
Ralph Wessel
Mentor
vuego wrote:
My Addon creates API_Element (GDL object) on user specified coordinates acquired with APIIo_GetPointID. X and Y coordinates are ok, Z coordinate is always zero. I would like to use gravity when picking a point on eg Mesh so Z coordinate gets populated too.
I don't know if there is a shortcut to achieving this. You could get the 3D body of the mesh from ModelAccess or the older 3D Manager (ACAPI_Element_Get3DInfo etc). You could then determine which face lies directly under the point of interest and the z level on the plane at that point.
Ralph Wessel BArch
Miha Nahtigal
Advocate
I've decided to change my object creation concept.

Switched from APIelement creation to new element event observer and let user use default gravity functionality of AC. API magic is fired afterwards.
BIMquants.comBETA - Quantities and Costs Estimation with Archicad AddOn :: rushing to publish a beta preview
Learn and get certified!