Hi Dylan,
thanks so much for your answer and details ! really appreciate it!
I´m using already the IFCMesh, however it´s not creating an IFC object but a 3DMesh instead, so there is no way to assign any property to say i.e. this is a IFCwall object.
## create object ((container is usually worldview))shell = wv.Add(clr.GetClrType(IFCMesh))faceList = Array[int]ptPoint1 = Point3D(pt1.Position.X, pt1.Position.Y, pt1.Position.Z) ptPoint2 = Point3D(pt2.Position.X, pt2.Position.Y, pt2.Position.Z)ptPoint3 = Point3D(pt2.Position.X, pt2.Position.Y, pt2.Position.Z + Double(myHeight))ptPoint4 = Point3D(pt1.Position.X, pt1.Position.Y, pt1.Position.Z + Double(myHeight))vertexArray = Array[Point3D]([ptPoint1, ptPoint2, ptPoint3, ptPoint4])emptyArray = Array[Point3D]([])faceList = (4, 0, 1, 2, 3)shell.CreateShell(0, self.currentProject.Guid , vertexArray, faceList, emptyArray, Color.LightGray.ToArgb())I´m also using the empty array after struggling a lot with different things I tried.
I´m offering the option in my Buildings plugin to the customer to create 3 different types of 3D objects: Linestring, 3D Face and/or 3D Mesh (actually an IFCMesh but has nothing to do with IFC but just a 3D mesh). The reason why offering 3 different 3D objects is because limitations i.e. in cutting plane views where Linestrings are not shown.

Coming back to IFC objects, TBC supports IFC schema but does not allow (so far I know) to create new IFC objects inside it. Even if I import an IFC file and then create my own IFCMesh objects, and try to export them to IFC, I get a message that only the imported IFC objects can be exported, so you can simply update attributes of an IFC object but not create new ones which is what I really need.
I´ve been checking for months the options to export myself to IFC but it´s a huge work to reinvent the wheel, when TBC already support so much of IFC and can import IFC and work with that, therefore obviuously I would like to use the current functionality inside TBC instead of creating my own IFC module.
Please correct me if I´m wrong and there is a way to export the created IFCMeshes to IFC through any workaround or similar or there is another way to create IFC objects that can be exported to IFC through the TBC exporter.
Thanks so much again for your support, Dylan!
Regards,
Fernando
------------------------------
Fernando Calvo
calvo@calvo-geospatial.com------------------------------
Original Message:
Sent: 02-09-2022 17:29
From: Dylan Towler
Subject: Creating new IFC objects in TBC
Hi Fernando,
Here's a bit of code that creates a new IFC (it's C# but the calls and types will map directly onto the python macro language).
IFCMesh newShell = worldView.Add<IFCMesh>();
Point3D[] normals = new Point3D[0];
var newShellColor = mesh.Color;
newShell.CreateShell(0, Guid.Empty, verticies.ToArray(), faces.ToArray(), normals, newShellColor);
newShell.Mode = mesh.Mode;
newShell.Name = mesh.Name;
newShell.Description = mesh.Description;
newShell.Color = newShellColor;
Let me explain the parameters to the CreateShell method (to the best of my knowledge!)…
vertices – an array of all the Point3D vertices that make up the object (no particular order)
faces – an array of integers that describe all of the different faces that make up the IFC. It consists of the number of points for that face, followed by the list of vertex indexes, then repeat… I've only dealt with data that has sets of 3 vertices (triangles) but I assume if there are more than 3 vertices in a face then they have to be co-planar. (I'm pretty sure from memory the indices into the vertices parameter are 0 based btw).
I've always just passed an empty array in for the normals argument. Perhaps this defines the inside versus outside for a each face or something… I'm not sure.
Hope this helps!
------------------------------
Dylan Towler
dylan_towler@buildingpoint.com.au
Original Message:
Sent: 12-22-2021 11:58
From: Fernando Calvo
Subject: Creating new IFC objects in TBC
Hi,
I´m trying to create new IFC objects in TBC and so far I understand, it is not possible but only updating imported IFC objects and when exporting the data scheme needs to be selected and only previously imported IFC objects are exported, is this correct?
Is there any way to create a new IFC object, no matter if a previous requirement is to import an IFC file to have a data scheme or similar?
I´ve found several type of functions that could point in this direction to create IFC objects but not sure if this is even possible. At the moment creating IFCMesh objects which basically are at the end of the day Shell3D´s instead of anything related to IFC so a bit confused about that.
I would appreciate any help on that.
Thanks a lot.
Regards,
Fernando
------------------------------
Fernando Calvo
calvo@calvo-geospatial.com
------------------------------