We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-04-22 01:52 PM - last edited on 2024-09-16 02:41 PM by Doreena Deng
Hi Graphisoft Community!
I am looking for a straight forward way to draw/place (create and display) a 3D point in ArchiCAD. I am trying to use Point3D from C:\Program Files\Graphisoft\API Development Kit 27.3001\Support\Modules\Geometry\Vector3D.hpp to create a point, but I see no option to display this point on ArchiCAD.
Any assistance on this topic will be of great help!!!
Thank You,
CAD Developer.
Solved! Go to Solution.
2024-06-05 04:02 PM
You can create the object just using the built-in library part creation tools (File > Libraries and Objects > New Object…)
You could create parameters to store the x/y/z coordinates and a 3D script render them. You can create library parts in the add-on too, but I don't think it will help in this case (but if you're interested, refer to the LibPart_Test example project, specifically Do_CreateLibraryPart).
Either way – once you have an object – the add-on could place instances of this object and fill the relevant parameters with the coordinates. There is similar code for placing a window object in the Element_Test example, specifically Do_CreateWindow.
2024-04-28 10:05 PM
Think of Point3D (and for any class/struct in the Geometry folder) as a maths tool for creating geometric bodies, but not directly for visualisation.
The only classes that directly contribute to 2D and 3D visualisation can all be found in the API_Element union, e.g. API_WallType (for walls), API_SlabType (for slabs), API_ObjectType (for objects) etc. and are generally called 'elements'. Archicad is generally not about raw geometry. Elements are at the core of a project - when Archicad renders that content, the raw geometry is generated on demand from the elements.
So if you want a point in the 3D model, you need to create an element that will generate that point for you. The most obvious choice would be a GDL object - the object could have parameters for one or more points that are populated by the add-on, and when placed in the project it renders the point(s) for you.
You cannot directly inject raw geometry into a scene as a Point3D.
2024-06-05 03:23 PM
Hi @Ralph Wessel ,
Thank you for your detailed response. I appreciate the clarification on how raw geometry is handled within Archicad.
Could you please provide a clear step-by-step guide on how to create a GDL object using C++ code ( I need to create this object inside my add on)? This will help me understand how to use GDL objects to render points within the project.
Thank you!
2024-06-05 04:02 PM
You can create the object just using the built-in library part creation tools (File > Libraries and Objects > New Object…)
You could create parameters to store the x/y/z coordinates and a 3D script render them. You can create library parts in the add-on too, but I don't think it will help in this case (but if you're interested, refer to the LibPart_Test example project, specifically Do_CreateLibraryPart).
Either way – once you have an object – the add-on could place instances of this object and fill the relevant parameters with the coordinates. There is similar code for placing a window object in the Element_Test example, specifically Do_CreateWindow.
2024-06-20 11:57 AM
Hello @Ralph Wessel ,
Thank you for the response. I am able to create GDL object sphere and I am working on setting position for the object through code. However, I need to change the material of the object so that I can assign colors to the sphere. Can you suggest any documentation or solution so that I can change the material and color of the GDL object?
Eagerly waiting for you response.
Regards.
CAD Developer.
2024-06-20 12:15 PM
GDL supports a wide variety of parameter types, including materials. I suggest adding another parameter to your object for material and populating that in your code in addition to the sphere position.