IfcPeek command-line filtering and reporting for IFC files
Here's a new tool. It is a command-line for querying an IFC model using the Selector syntax that we know from Bonsai BIM.
It is an interactive tool with history, tab completion, syntax highlighting etc.. so you can use it to explore your models. It is also scriptable, so you can pipe a query and save CSV output with formatted values. More information here:
Comments
Very, very cool!
@brunopostle looks amazing
for us mortals not so used to these things, would you please show the actual installation steps? does it work in a terminal window ?
the first went through ok but the second
pip install -e .
returned an errorthanks for your help
@steverugi it hasn't been uploaded to pypi, so these are instructions to install it from a local clone of the git repository. I haven't tested installing on windows, but it should be fine. Please do ask until you get it working, you are the target audience for this tool.
@brunopostle
do I have to repeat the
pip intsall -e .
until it works? OK will try again soonwow! much obliged
cheers
@steverugi you need to start with a git clone of the repository. If you can't manage that you can download a zip archive from Github, unzip it and install from there
thank you @brunopostle for your kind reply
dealing with clones (in life or in a repository) is in my bucket list, will try again when the module will be made available, no problema
cheers
@steverugi you can download a zip from here: https://github.com/brunopostle/ifcpeek/archive/refs/heads/main.zip
@steverugi I figured out how to make a package, install with pip:
thank you @brunopostle
it went through! no issue, now I'm on board with your new feature :)
After using it for a little time I have to say the experience is quite impressive
also, all is very well documented with a number of use cases.
When data is what you need (I do) your IfcPeek can be of great help, it can be run on any computer with access to the .ifc file, really sleek
I am going to test it in depth over the next few days to give you a better feedback.
I am truly grateful
@brunopostle
I used this to get a list of column and beams with their net volume m3, OK
when the same query is used in the export to .csv as explained in your page
it returns an error:
Thanks again for your work
PS the example in your page
Qto_.*Quantities.NetVolume
should read/Qto_.*BaseQuantities/.NetVolume
I think@steverugi I think you have a backtick at the beginning of your command instead of a normal single-quote mark, this looks like a copy-paste error (though it could still be a problem with ifcpeek).
This works here:
Thanks, there were some errors in the README, fixed.
There are also definitely some bugs, tab-completion doesn't work with
Qto_BeamBaseQuantities.<TAB>
when it should offerNetVolume
andOuterSurfaceArea
etc..Hi @brunopostle
thanks for the quick reply
maybe the backtick was added to format the string, let me paste here its full text (I just used yours changing only the .ifc file name):
despite the same works fine inside ifcpeek, when used to output the error persists:
thanks again for your assistance
PS how would you use round() when the quantity selector contains .*?
PS2 I created a dummy "_test.ifc" file to use your exact query and the result did not change
I can definitely reproduce your error by including a ` at the beginning of the string. This could be a bug in the untested Windows support, as a workaround can you put the query in a text file? like this:
It looks like
round()
,int()
etc.. don't work when the content is a regular expression, another bug..the workaround did work out!, thanks a lot
maybe an improvement in the future could be to add the headers? ;)
@steverugi Ahh, figured it out, on Windows you have use " a double-quote character instead of a ' single-quote character to quote strings (which is a pain because the selector syntax uses double-quotes).
I'll add it to the TODO list
@brunopostle
alas, using double quotes returns the same error, but the workaround works fine
@brunopostle awesome, thanks!
I added a CSV headers feature, fixed the bug where formatting didn't work when the value was a regular expression, and improved the tab completion of Psets, Qtos, EPsets etc.. New release here:
https://github.com/brunopostle/ifcpeek/releases/tag/1.0.1
Hi @brunopostle
I am testing the update and looks OK
how do you set headers in the csv using ifcpeek please?
thanks
Oops forgot to update the README, just use:
ifcpeek --headers
@brunopostle
it works
for next development I'd like to suggest introduction of alias, to avoid long headers like:
in ifccsv I can use
--headers "Type" "m3"
for instance ....or it's there already?
thanks again for your work
The
round()
formatting shouldn't appear, this is a bugping newcomer @IliaShkola
welcome to the platform
maybe you like ifcseek by @brunopostle here ?
@steverugi
Yeah, I actually saw it and even gave it a quick test — but by the time I found it, I had already built my own XLSX export tool :D Mine takes a bit of a different route though — "Far Manager meets Vim-style navigation".
@IliaShkola you should introduce your new tool in a new thread as I'm sure it is of interest. It's more interactive than ifcpeek, so it will have different use cases.