Menu

Help: Create a time series with IfcOpenShell

2021-12-23
2021-12-24
  • Simone Maioli

    Simone Maioli - 2021-12-23

    Hi everyone I'm trying to instantiate a time series with IfcOpenShell for my research, I assign all the necessary attributes by consulting BuildingSmart but the terminal gives me an error that I don't find sense. It tells me that it expects an "AggregateofEnityInstance" instead of simple values, can you tell me why?
    Thanks for your help

    tsvalues = [1,2,3]
    timeseries = ifc_f.createIfcRegularTimeSeries("Acceleration Data", None, "2021-06-19T08:10:15Z", "2021-06-19T10:00:00Z", "DISCRETE","MEASURED",None, acc,2,tsvalues)
    

    Terminal:

    ValueError: Expected AggregateOfEntityInstance for attribute IfcRegularTimeSeries.Values, got [1, 2, 3]`
    

    the last attribute must be an IfcValue is it correct that it is simply a list?

     

    Last edit: Simone Maioli 2021-12-24
    • Thomas Krijnen

      Thomas Krijnen - 2021-12-24

      As is often the case in IFC, there are a couple more indirection to get to the actual data.

      First you need to create a IfcTimeSeriesValues, which contains a list of IfcValue, so you also need to provide a concrete type for your values.

      This should work:

      tsvalues = [f.createIfcTimeSeriesValue([f.createIfcInteger(i) for i in [1,2,3]])]
      
       
      👍
      1
  • Simone Maioli

    Simone Maioli - 2021-12-24

    thanks it works! I have yet to get into the IFC mindset

     

Log in to post a comment.