public class LinkWorld
{
public static DbElement LinkWLD => Aveva.Pdms.Database.DbType.Design.FindElements(DbElementTypeInstance.LINKWLD).FirstOrDefault();
}
public class LinkDescription
{
public DbElement CurElement { get; set; }
public string Description { get; set; }
public string RefNo { get; set; }
public DbElement LnkRef { get; set; }
public DbElement[] LnkElements { get; set; }
public string LnkUse { get; set; }
public string Url { get; set; }
public LinkDescriptorUsage LinkUsage { get; set; }
public bool LnkRefMissOut => this.LnkRef == DbElement.GetElement();
public LinkDescription(DbElement eleLinkDesc)
{
this.CurElement = eleLinkDesc;
this.RefNo = eleLinkDesc.GetAsString(DbAttributeInstance.REF);
this.Description = eleLinkDesc.GetAsString(DbAttributeInstance.DESC);
this.LnkRef = eleLinkDesc.GetElement(DbAttributeInstance.LNKREF);
this.LnkElements = eleLinkDesc.GetElementArray(DbAttributeInstance.LNKELE);
this.Url = eleLinkDesc.GetAsString(DbAttributeInstance.URL);
this.LnkUse = eleLinkDesc.GetAsString(DbAttributeInstance.LNKUSE);
this.LinkUsage = this.LnkUse.GetEnum<LinkDescriptorUsage>();
}
public static List<LinkDescription> LinkDescriptions => LinkWorld.LinkWLD.FindElements(DbElementTypeInstance.LNDESC, c => c.Members().Any()).Select(c => new LinkDescription(c)).ToList();
public static List<LinkDescription> LinkDesPlateGenFilesList => LinkWorld.LinkWLD.FindElements(DbElementTypeInstance.LNDESC, c => c.Members().Any()).Select(c => new LinkDescription(c)).Where(c => c.LinkUsage == LinkDescriptorUsage.UPMGEN).ToList();
public static List<LinkDescription> LinkDesPlanePartGeneration => LinkWorld.LinkWLD.FindElements(DbElementTypeInstance.LNDESC, c => c.Members().Any()).Select(c => new LinkDescription(c)).Where(c => c.LinkUsage == LinkDescriptorUsage.DPPAN).ToList();
public static List<LinkDescription> LinkDesProfileSketch => LinkWorld.LinkWLD.FindElements(DbElementTypeInstance.LNDESC, c => c.Members().Any()).Select(c => new LinkDescription(c)).Where(c => c.LinkUsage == LinkDescriptorUsage.DPROF).ToList();
}
public enum LinkDescriptorUsage
{
[Description("Profile nesting")]
DPNEST = 0,
[Description("Nested profile csv")]
UNPRC = 1,
[Description("Nested profile list")]
UNPRL = 2,
[Description("Weld report")]
UWELDR = 3,
[Description("Plate generic file")]
UPMGEN = 4,
[Description("Weight and centre of gravity sketch")]
DWCOG = 5,
[Description("Weight and centre of gravity csv")]
UWCOG = 6,
[Description("Parts list sketch - profiles")]
DPRTPR = 7,
[Description("Parts list sketch - plates")]
DPRTPL = 8,
[Description("Parts list - profiles")]
UPRTPR = 9,
[Description("Parts list - plates")]
UPRTPL = 10,
[Description("Mounting data profile")]
UMNTPR = 11,
[Description("Manstiff csv")]
UMANSC = 12,
[Description("Manstiff list")]
UMANSL = 13,
[Description("Profile sketch")]
DPROF = 14,
[Description("Profile generic file")]
UPRGEN = 15,
[Description("List of Split Plane Panel Parts")]
UPPAN = 16,
[Description("Plane panel parts generation")]
DPPAN = 17
}