public GeometryCurve(Autodesk.Revit.DB.CurveElement curve) { this.Id = curve.Id.IntegerValue; List_AdjoinedElementsEnd0 = curve.GetAdjoinedCurveElements(0).Select(i => i.IntegerValue).ToList(); List_AdjoinedElementsEnd0 = curve.GetAdjoinedCurveElements(0).Select(i => i.IntegerValue).ToList(); this.LineType = Enum.GetName(typeof(CurveElementType), curve.CurveElementType); if (curve.CurveElementType == CurveElementType.ModelCurve) { ModelCurve mcurve = curve as ModelCurve; this.LineFormType = mcurve.GeometryCurve.ToString(); this.IsDetailLine = false; this.geomVisibility = new GeometryVisibility(mcurve.GetVisibility()); this.HasTangentLockEnd0 = mcurve.HasTangentLocks(0); this.HasTangentLockEnd1 = mcurve.HasTangentLocks(1); //this.HostId = mcurve.LevelId.IntegerValue; try { this.SubcategoryName = mcurve.Subcategory.Name; } catch { this.SubcategoryName = "null"; } this.TypeName = mcurve.LineStyle.Name; } else if (curve.CurveElementType == CurveElementType.SymbolicCurve) { SymbolicCurve mcurve = curve as SymbolicCurve; this.LineFormType = mcurve.GeometryCurve.ToString(); this.IsDetailLine = false; this.geomVisibility = new GeometryVisibility(mcurve.GetVisibility()); this.HasTangentLockEnd0 = mcurve.HasTangentLocks(0); this.HasTangentLockEnd1 = mcurve.HasTangentLocks(1); //this.HostId = mcurve.LevelId.IntegerValue; this.SubcategoryName = mcurve.Subcategory.Name; this.TypeName = mcurve.LineStyle.Name; } }