Class IfcApi

java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.IfcApi

public class IfcApi extends SubApi
IFC related API calls
  • Constructor Details

  • Method Details

    • downloadModel

      public InputStream downloadModel(UUID versionUuid) throws BimWorksException
      Download a model, this will return the byte-for-byte original IFC model
      Parameters:
      versionUuid - The UUID of the Version to download
      Returns:
      An InputStream that can be used to get the content. Responsibility for closing this stream is on the caller.
      Throws:
      BimWorksException
    • downloadModel

      public InputStream downloadModel(UUID versionUuid, String targetSchema) throws BimWorksException
      Download a model converted to another IFC schema. The only supported conversion is IFC2X3 to IFC4; every other one is refused with a message that names the supported ones. A target schema that the model already has is no error: the model is then downloaded as it was uploaded. The objects of the converted file have the express ids and the GlobalIds of the model. A conversion can take minutes for a large model, so this call waits up to 30 minutes; the converted file is kept on the server, so a second request is answered at once. What the conversion lost and added is in getSchemaConversionReport(UUID, String).
      Parameters:
      versionUuid - The UUID of the Version to download
      targetSchema - The schema to convert to, for example "IFC4"
      Returns:
      An InputStream that can be used to get the content. Responsibility for closing this stream is on the caller.
      Throws:
      BimWorksException
    • downloadModel

      public InputStream downloadModel(UUID versionUuid, String targetSchema, boolean validate) throws BimWorksException
      Parameters:
      validate - Whether the server holds the converted file against the schema check before it serves it. This about doubles the time of a conversion. The result of the check is part of the response of the task, which this method does not return: use the task API for it
      Throws:
      BimWorksException
    • getSchemaConversionReport

      public com.fasterxml.jackson.databind.node.ObjectNode getSchemaConversionReport(UUID versionUuid, String targetSchema) throws BimWorksException
      The log of a schema conversion: what it lost, added and changed. Reads a log, converts nothing: a conversion that was never made is not found.
      Parameters:
      versionUuid - A Version that was made by CONVERT SCHEMA, or, with targetSchema, the Version that was downloaded converted
      targetSchema - Only for a converted download, the schema it was converted to; else null
      Returns:
      conversion (the numbers), report (the findings, capped per rule) and detail_log
      Throws:
      BimWorksException
    • downloadErrorModel

      public InputStream downloadErrorModel(UUID errorUuid) throws BimWorksException
      Download the IFC model of an Error. This can be useful for debugging.
      Parameters:
      errorUuid - The UUID of the Error
      Returns:
      An InputStream that can be used to get the content. Responsibility for closing this stream is on the caller.
      Throws:
      BimWorksException
    • export

      public InputStream export(Set<UUID> versionUuids, String query) throws BimWorksException
      Export a new IFC model from one or more models, filtered by the given query. The query should not contain a GET statement, if it does it is ignored. Only subclasses of IfcProduct can be queried. By default all geometric representations are also included in the results. The decomposes/containment tree all the way up to IfcProject is included for each result. For IfcProject also the UnitAssignment is always included, as are the OwnerHistory objects, to make it a valid IFC file. When querying multiple models, it should be expected that the resulting IFC will not be valid. For example it will usually have multiple IfcProject entities.
      Parameters:
      versionUuids - The Version UUIDs of the models to query
      query - The BQL query to filter by
      Returns:
      An InputStream, closing the InputStream is the responsibility of the caller
      Throws:
      BimWorksException
    • downloadIfcXml

      public InputStream downloadIfcXml(UUID versionUuid) throws BimWorksException
      The model as ifcXML (generated on first request and cached server-side). The caller closes the stream.
      Throws:
      BimWorksException