Monday 28 August 2017

VB net Serialization : ShouldSerialize boolean function (not in MSDN)

When serializing a property it is possible to include it or exclude it using the boolean function ShouldSerializeXXXX where XXXX is the exact name of the property !
In MSDN there is no straight reference to it.

eg

<SXS.XmlAttribute(AttributeName:="desc")> Public Property desc As String = String.Empty

Public Function ShouldSerializedesc() As Boolean
   If desc = String.Empty Then Return False Else Return True
End Function

FeatureLine based Corridor Baseline results to hidden Alignment & Profile exposed through API !!!

I develop a custom Civil 3D plugin to export alignments, profiles and corridor cross sections to LandXML.
I used a dwg with various cases for testing.
There was a case of a Corridor that uses a Feature Line for Baseline.
When getting Alignments and Profiles i found out that Civil 3D creates a hidden Alignment and Profile for this Feature Line !!!
The Profile type although unnamed has an enum value of 5 !!!