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

XML_Toolkit: Rename depth property from XMLDepth to Depth #561

Merged
merged 2 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions XML_Engine/Query/Depth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ public static partial class Query
/**** Public Methods ****/
/***************************************************/

[Description("Returns the 'depth' property of a markup object as a double. If the value cannot be converted to a double (if the value is null or blank for example) then an error will be provided and -1 will be returned.")]
[Description("Returns the 'depth' property of a markup object as a double. If the value cannot be converted to a double (if the value is null or blank for example) then an error will be provided and 0 will be returned.")]
[Input("markup", "A markup object which contains the 'depth' property.")]
[Output("depth", "The depth value as a double, or -1 if the value could not be converted to a double.")]
[Output("depth", "The depth value as a double, or 0 if the value could not be converted to a double.")]
public static double Depth(this Markup markup)
{
if (markup == null)
return -1;
return 0;

try
{
return System.Convert.ToDouble(markup.XMLDepth);
return System.Convert.ToDouble(markup.Depth);
}
catch (Exception e)
{
BH.Engine.Base.Compute.RecordError($"Could not convert XMLDepth value {markup.XMLDepth} to numerical depth.");
return -1;
BH.Engine.Base.Compute.RecordError($"Could not convert XMLDepth value {markup.Depth} to numerical depth.");
return 0;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion XML_oM/Bluebeam/BluebeamObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace BH.oM.XML.Bluebeam
public class BluebeamObject : IBHoMObject
{
[XmlIgnore]
public virtual Guid BHoM_Guid { get; set; }
public virtual Guid BHoM_Guid { get; set; } = Guid.NewGuid();
[XmlIgnore]
public virtual Dictionary<string, object> CustomData { get; set; }
[XmlIgnore]
Expand Down
4 changes: 3 additions & 1 deletion XML_oM/Bluebeam/Markup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -64,8 +65,9 @@ public class Markup : BluebeamObject
[XmlElement("Label")]
public virtual string Label { get; set; }

[Description("By default this is an XML String representation. Most software will automatically handle the conversion to a numerical representation but users can also use the Query.Depth(Markup) method if necessary.")]
[XmlElement("Depth")]
public virtual string XMLDepth { get; set; }
public virtual string Depth { get; set; }

[XmlElement("Layer")]
public virtual string Layer { get; set; }
Expand Down