@Moult said:
That batch script won't give you the correct values depending on all sorts of factors, like whether or not the grid has a non-zero placement, a rotation, georeferencing, etc. Coordinates are relative to other coordinates so you need to do matrix math. This is where libraries like IfcOpenShell come in.
You don't need admin rights to install either Blender, the BlenderBIM Add-on, Python, or IfcOpenShell. They are all portable (Blender has a zip file, or if you don't want Blender, you can use a portable Python) and you can accompany it with a small Python script that they can drag and drop files onto.
@CSN said:
As Moult says, trying to use batch to work with IFC is cursed to say the least. However , if, like me, you like to do things in ways which make very little logical sense and probably don't work in large numbers of use cases - then you can try to use the following batch script.
Big disclaimer that all I tested this on was an IFC from Tekla which contained nothing but an IFCGRID. I have absolutely no idea if it will work for IFCs that are made outside of Tekla, or IFCs with more than a single Grid in them, or on Grids which have been transformed/rotated etc etc.
I really only made this just to see what I could hack together using batch. I am not an expert in batch scripting - in fact I'm very amateur - but this was a fun hack together that taught me some more batch scripting tricks.
Hi Dion, thank you very much for your feedback and congratulations on everything you do. I have followed your progress from afar since you started BlenderBim... but I lack time to delve (for the moment) into the subjects that speak more to programmers than to me (ifcopenshell...). For the script, as I told you, I am not a coder at all and I am therefore forced to limit myself to asking chatgpt for help to create a simple batch (...) but I keep in mind the possibility to create a script without my colleagues having to do any installations.
For the rest, don't worry, I am well aware of the differences and constraints linked to the positioning of the ifc. I know that there are limits and that we will therefore not spontaneously obtain the same thing with an ifc Tekla as with an ifc revit or archicad...
like @CSN we work with TEKLA, a large quantity of IFCs come from TEKLA (and among these many are in Millimeters and positioned at the origin... because many of them are not produced with the aim of a BIM construction site). So I was looking for a very small and easy solution to help my colleagues create their grid while saving time... and if they have to modify it by hand afterwards, it doesn't matter... modifying the grid n It's not complicated.
@CSN, I tested your batch on the test that I had done (also a simple grid to start with of course) and the result worked as you can imagine :) being consistent with what we need in TEKLA (the GRD file being very simple) ... the approach to an XML file would be much more complex ... I will see that (or not) much later if the desire comes :) ... for information, I tested with another larger project... it didn't work any better than mine ;)...
Thank you all and if by chance someone finds a small program to facilitate the recovery of values, don't hesitate! :) !
BR
David