removePSet method
- IInstance instance,
- IInstance pset
Removes a specific property set from an instance.
This method disassociates the property set relationship from the instance. If the IfcRelDefinesByProperties relationship no longer references any products, it will be removed from the database to maintain data integrity.
Changes to instance and pset are persisted to the database.
Returns true if the property set was successfully removed,
or false if:
- Either instance handle is invalid
- The property set association does not exist
- The operation fails for any other reason
Example usage:
final psetRelationships = getPSets(wallInstance.instanceHandle);
if (psetRelationships.isNotEmpty) {
final success = removePSet(wallInstance, psetRelationships.first);
if (success) {
print('Property set removed successfully');
} else {
print('Failed to remove property set');
}
}
Implementation
@override
bool removePSet(IInstance instance, IInstance pset) {
if (instance is! PIInstance || pset is! PIInstance) {
return false;
}
return removePsetFFI(projectPtr, ptr, instance.ptr, pset.ptr);
}