Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Modifying "NominalValue" Attribute for "IfcPropertySingleValue" Using "setStringAttribute" #1321

Closed
saintcodec opened this issue Jul 19, 2024 · 1 comment

Comments

@saintcodec
Copy link

saintcodec commented Jul 19, 2024

I am encountering an issue when attempting to modify the NominalValue attribute of an IfcPropertySingleValue object using the setStringAttribute method within a transaction. Despite NominalValue visibly existing in the data retrieved by getDataObjectByOid, attempts to modify this attribute return an error stating that the attribute does not exist.

What i did:

  1. Retrieve an object using getDataObjectByOid, which shows NominalValue in the list of attributes.
{
  "response": {
    "result": {
      "__type": "SDataObject",
      "guid": "",
      "name": "",
      "oid": 525627,
      "rid": 0,
      "type": "IfcPropertySingleValue",
      "uuid": null,
      "values": [
        {
          "__type": "SListDataValue",
          "fieldName": "HasExternalReferences",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": []
        },
        {
          "__type": "SSimpleDataValue",
          "fieldName": "Name",
          "oid": -1,
          "rid": 0,
          "stringValue": "PowerFactor",
          "uuid": null
        },
        {
          "__type": "SSimpleDataValue",
          "fieldName": "Description",
          "oid": -1,
          "rid": 0,
          "stringValue": null,
          "uuid": null
        },
        {
          "__type": "SListDataValue",
          "fieldName": "PartOfPset",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": [
            {
              "__type": "SReferenceDataValue",
              "fieldName": null,
              "guid": null,
              "oid": 525224,
              "rid": 0,
              "typeName": "IfcPropertySet",
              "uuid": null
            }
          ]
        },
        {
          "__type": "SListDataValue",
          "fieldName": "PropertyForDependance",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": []
        },
        {
          "__type": "SListDataValue",
          "fieldName": "PropertyDependsOn",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": []
        },
        {
          "__type": "SListDataValue",
          "fieldName": "PartOfComplex",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": []
        },
        {
          "__type": "SListDataValue",
          "fieldName": "HasConstraints",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": []
        },
        {
          "__type": "SListDataValue",
          "fieldName": "HasApprovals",
          "oid": -1,
          "rid": 0,
          "uuid": null,
          "values": []
        },
        {
          "__type": "SSimpleDataValue",
          "fieldName": "NominalValue",
          "oid": -1,
          "rid": 0,
          "stringValue": "1.0",
          "uuid": null
        }
      ]
    }
  }
}
  1. Start a transaction using startTransaction.

  2. Attempt to modify the NominalValue attribute using:

{
  "token": "<access_token>",
  "request": {
    "interface": "LowLevelInterface",
    "method": "setStringAttribute",
    "parameters": {
      "tid": "<transaction_id>",
      "oid": 525627,
      "attributeName": "NominalValue",
      "value": "22"
    }
  }
}
  1. Commit the transaction.

Server response:

{
  "response": {
    "exception": {
      "__type": "UserException",
      "message": "No attribute with the name \"NominalValue\" found in class \"IfcPropertySingleValue\""
    }
  }
}

BIMserver version: 1.5.184

Could someone please assist in clarifying why this issue might be occurring, and if there's a specific approach or method required for modifying attributes such as NominalValue for IfcPropertySingleValue objects in BIMserver?

@hlg
Copy link
Member

hlg commented Jul 30, 2024

A similar question has been asked before - it is a duplicate of #621.

From the attributeName "PowerFactor" and the original value "1.0", I assume this property is part of a Pset_ElectricalDeviceCommon property set. Thus you want to use the method setWrappedDoubleAttribute with type IfcNormalisedRatioMeasure.

@hlg hlg closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants