@Moult said:
@Lurker it's in the IfcOpenShell docs: https://blenderbim.org/docs-python/ifcopenshell-python/selector_syntax.html because it is used in multiple tools and available in IfcOpenShell-Python.
nice!.. i'll take down the wiki page then.
@Moult said:
@Lurker it's in the IfcOpenShell docs: https://blenderbim.org/docs-python/ifcopenshell-python/selector_syntax.html because it is used in multiple tools and available in IfcOpenShell-Python.
nice!.. i'll take down the wiki page then.
Is there an equivalent for...
``int({{Qto_SpaceBaseQuantities.NetFloorArea}})`` SF
in the new facet system?
I tried...
``round({{Qto_SpaceBaseQuantities.NetFloorArea}})`` SF
but it doesn't work.
The following works though, but I'd like to remove the decimal place.
``round({{Qto_SpaceBaseQuantities.NetFloorArea}},.1)`` SF
The round
function means "round to the nearest X". This means that rounding to 1 is probably what you want :)
``round({{Qto_SpaceBaseQuantities.NetFloorArea}},1)``
I had tried that, but it still has the decimal in it.
Now fixed I believe :)
Regarding query-syntax, the '>=' sign doesn't seem to work
@c4rlosdias yes, it is not yet implemented. Would you like to try?
ok @Moult , I'll try
I think should be useful use the query syntax in the IfcClash Tool too.
What do you think? Is it in the roadmap?
Thanks for your work
Yes indeed it's in the roadmap - basically everywhere people should have the option to use the graphical selector from now on. Would you mind filing a bug on Github, or if you're keen, helping code it?
Good news thanks, i'll fill a bug (request) asap (edit: https://github.com/IfcOpenShell/IfcOpenShell/issues/4069). Help coding I think it's hard for me (basic knowledge) but if you think it's easy give me some hint and i'll try
Obviously i'm not doing this correctly.
Anyone have any pointers?
@theoryshaw Try this: ``round({{Qto_SpaceBaseQuantities.NetFloorArea}}, 0.1)``
I tried that already--unfortunately get the following error.
Python: Traceback (most recent call last):
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 68, in _call_userfunc
return f(children)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\selector.py", line 198, in round
value = Decimal(args[0] or 0.0)
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\drawing\operator.py", line 75, in execute
IfcStore.execute_ifc_operator(self, context)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\ifc.py", line 340, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\drawing\operator.py", line 2198, in _execute
core.edit_text(tool.Drawing, obj=context.active_object)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\core\drawing.py", line 32, in edit_text
drawing.update_text_value(obj)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\tool\drawing.py", line 898, in update_text_value
props.literals[i].value = cls.replace_text_literal_variables(literal.Literal, product)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\tool\drawing.py", line 1397, in replace_text_literal_variables
text = text.replace(original_command, ifcopenshell.util.selector.format(command[2:-2]))
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\selector.py", line 252, in format
return FormatTransformer().transform(format_grammar.parse(query))
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 105, in transform
return self._transform_tree(tree)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 101, in _transform_tree
children = list(self._transform_children(tree.children))
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 92, in _transform_children
yield self._transform_tree(c)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 101, in _transform_tree
children = list(self._transform_children(tree.children))
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 92, in _transform_children
yield self._transform_tree(c)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 102, in _transform_tree
return self._call_userfunc(tree, children)
File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\libs\site\packages\lark\visitors.py", line 72, in _call_userfunc
raise VisitError(tree.data, tree, e)
lark.exceptions.VisitError: Error trying to process rule "round":
[<class 'decimal.ConversionSyntax'>]
@theoryshaw I got this error because I didn't have created the Qto_SpaceBaseQuantities
in the IfcSpace object yet. After I created, it worked. Maybe is something with the Object Quantity Sets? Or maybe the annotation is not assigned to the right object?
I tested with your file by creating a new space and a new annotation and it worked.
Hmm.. not working on my end.
Can you try this file? https://www.dropbox.com/scl/fi/y1f7f6s891o72vi2xf0vb/Restaurant_Sun_Prairie.ifc?rlkey=dxi6pr6lhepiqz2b6b3bvyaes&dl=1
Drawing: FLOOR PLAN - 1ST
That's weird, it worked here. I just added the double backtricks:
Dang, which commit are you on?
Nevermind... I ran Purged HDF5 Cache
and it fixed it.
Thanks, for helping!
I think i spoke too soon. It worked once, and then didn't again, even after the Purged HDF5 Cache
step. :\
Sorry, i 'think' I got it. I reinstalled BB, but I 'think' maybe it was because I was trying to change the 'instance' and not the 'type'.
Sorry, i'm still running into problems. This is a weird bug, sometimes it works, other times, not.
Fixed https://github.com/IfcOpenShell/IfcOpenShell/commit/6ea1e378c5f8bfd28fb3f8d3efeb958cd2468585
Probably doing something silly, but neither of the following seem to work
IfcFurniture, predefined_type = CHAIR
or
IfcFurniture, ObjectType = CHAIR
or
IfcFurniture, PredefinedType = CHAIR
@theoryshaw you have to use quotes so:
IfcFurniture, PredefinedType="CHAIR"
When i don't know exactly how to write the query, i find useful to use the UI first and after that copy the query text from the pop up menu like this:
Login or Register to reply.