/// <summary> /// Add an error message to the log file indicating an inability to create a Revit element from an IFCRoot or IFCMaterial. /// </summary> /// <param name="entity">The IFCEntity object.</param> /// <param name="optionalMessage">An optional message to replace the default.</param> /// <param name="throwError">True if we should also throw an error.</param> public void LogCreationError(IFCEntity entity, string optionalMessage, bool throwError) { if (string.IsNullOrWhiteSpace(optionalMessage)) { LogError(entity.Id, "couldn't create associated Revit element(s)", throwError); } else { LogError(entity.Id, optionalMessage, throwError); } }
/// <summary> /// Does a top-level check to see if this entity is equivalent to otherEntity. /// </summary> /// <param name="otherEntity">The other IFCEntity.</param> /// <returns>True if they are equivalent, false if they aren't, null if not enough information.</returns> /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types. This is intended /// to be used by derived classes.</remarks> public override bool? MaybeEquivalentTo(IFCEntity otherEntity) { bool? maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity); if (maybeEquivalentTo.HasValue) return maybeEquivalentTo.Value; if (!(otherEntity is IFCPresentationLayerWithStyle)) return false; IFCPresentationLayerWithStyle other = otherEntity as IFCPresentationLayerWithStyle; if (!IFCEntity.AreIFCEntityListsEquivalent(LayerStyles, other.LayerStyles)) return false; return null; }
/// <summary> /// Does a top-level check to see if this styled item may be equivalent to another styled item. /// </summary> /// <param name="otherEntity">The other styled item.</param> /// <returns>False if they don't have the same handles, null otherwise.</returns> public override bool? MaybeEquivalentTo(IFCEntity otherEntity) { bool? maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity); if (maybeEquivalentTo.HasValue) return maybeEquivalentTo.Value; if (!(otherEntity is IFCStyledItem)) return false; IFCStyledItem other = otherEntity as IFCStyledItem; if (!IFCRoot.Equals(Item, other.Item)) return false; if (!IFCRoot.Equals(Styles, other.Styles)) return false; return null; }
/// <summary> /// Does a top-level check to see if this entity is equivalent to otherEntity. /// </summary> /// <param name="otherEntity">The other IFCEntity.</param> /// <returns>True if they are equivalent, false if they aren't.</returns> /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types. This is intended /// to make a final decision, and will err on the side of deciding that entities aren't equivalent.</remarks> public override bool IsEquivalentTo(IFCEntity otherEntity) { bool? maybeEquivalentTo = MaybeEquivalentTo(otherEntity); if (maybeEquivalentTo.HasValue) return maybeEquivalentTo.Value; // If it passes all of the Maybe tests and doesn't come back false, good enough. return true; }
/// <summary> /// Does a top-level check to see if this entity may be equivalent to otherEntity. /// </summary> /// <param name="otherEntity">The other IFCEntity.</param> /// <returns>True if they are equivalent, false if they aren't, null if not enough information.</returns> /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types. This is intended /// to be used by derived classes.</remarks> public override bool? MaybeEquivalentTo(IFCEntity otherEntity) { bool? maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity); if (maybeEquivalentTo.HasValue) return maybeEquivalentTo.Value; if (!(otherEntity is IFCPresentationLayerAssignment)) return false; IFCPresentationLayerAssignment other = otherEntity as IFCPresentationLayerAssignment; if (!IFCNamingUtil.SafeStringsAreEqual(Name, other.Name)) return false; if (!IFCNamingUtil.SafeStringsAreEqual(Description, other.Description)) return false; if (!IFCEntity.AreIFCEntityListsEquivalent(AssignedItems, other.AssignedItems)) return false; if (!IFCNamingUtil.SafeStringsAreEqual(Identifier, other.Identifier)) return false; return null; }
/// <summary> /// Add an error message to the log file indicating an inability to create a Revit element from an IFCRoot or IFCMaterial. /// </summary> /// <param name="entity">The IFCEntity object.</param> /// <param name="optionalMessage">An optional message to replace the default.</param> /// <param name="throwError">True if we should also throw an error.</param> public void LogCreationError(IFCEntity entity, string optionalMessage, bool throwError) { if (string.IsNullOrWhiteSpace(optionalMessage)) LogError(entity.Id, "couldn't create associated Revit element(s)", throwError); else LogError(entity.Id, optionalMessage, throwError); }