OSArch Community

New IFC facet-based selector syntax

  1. T
  2. T

    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
    
  3. M

    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)``
    
  4. T

    I had tried that, but it still has the decimal in it.

  5. M

    Now fixed I believe :)

  6. C

    Regarding query-syntax, the '>=' sign doesn't seem to work

  7. M

    @c4rlosdias yes, it is not yet implemented. Would you like to try?

  8. C

    ok @Moult , I'll try

  9. B

    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

  10. M

    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?

  11. B
  12. T

    Obviously i'm not doing this correctly.

    Anyone have any pointers?

  13. B

    @theoryshaw Try this: ``round({{Qto_SpaceBaseQuantities.NetFloorArea}}, 0.1)``

  14. T

    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'>]
    
    

  15. B

    @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.

  16. T
  17. B

    That's weird, it worked here. I just added the double backtricks:

  18. T

    Dang, which commit are you on?

  19. T

    Nevermind... I ran Purged HDF5 Cache and it fixed it.

    Thanks, for helping!

  20. T

    I think i spoke too soon. It worked once, and then didn't again, even after the Purged HDF5 Cache step. :\

  21. T

    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'.

  22. T

    Sorry, i'm still running into problems. This is a weird bug, sometimes it works, other times, not.

  23. M
  24. T

    Probably doing something silly, but neither of the following seem to work

    
    IfcFurniture, predefined_type = CHAIR
    
    or
    
    IfcFurniture, ObjectType = CHAIR
    
    or
    
    IfcFurniture, PredefinedType = CHAIR
    
  25. M

    @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:

  1. Page 1
  2. 2
  3. 3
  4. 4
  5. 5

Login or Register to reply.