public _Mark(TSD.Mark mark, TSM.ModelObject part, TSD.ModelObject DRpart, TSD.ViewBase view) { _mark = mark; _part = part; _DRpart = DRpart; _view = view; }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Drawing drawing = drawingHandler.GetActiveDrawing(); DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Mark) { Tekla.Structures.Drawing.Mark drawingMark = (Tekla.Structures.Drawing.Mark)drawingObjectEnum.Current; if (label == "FrameColour") { drawingMark.Attributes.Frame.Color = frameColour; } if (label == "FrameType") { drawingMark.Attributes.Frame.Type = (FrameTypes)Enum.Parse(typeof(FrameTypes), frameType.ToString()); } drawingMark.Modify(); drawing.CommitChanges(); } } }
public void GetProperties() { DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected(); if (drawingObjectEnum.GetSize() == 1) { while (drawingObjectEnum.MoveNext()) { if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Mark) { Tekla.Structures.Drawing.Mark drawingMark = (Tekla.Structures.Drawing.Mark)drawingObjectEnum.Current; frameColour = drawingMark.Attributes.Frame.Color; frameType = (FrameTypeEnum)Enum.Parse(typeof(FrameTypeEnum), drawingMark.Attributes.Frame.Type.ToString()); } } } else if (drawingObjectEnum.GetSize() > 1) { frameColour = new DrawingColors(); FrameType = new FrameTypeEnum(); } }
public _Mark_BoltGroup(TSD.Mark mark, TSM.ModelObject part, TSD.ModelObject dr, TSD.ViewBase vv) : base(mark, part, dr, vv) { }
public _Mark_SingleRebar(TSD.Mark mark, TSM.ModelObject part, TSD.ModelObject dr, TSD.ViewBase vv) : base(mark, part, dr, vv) { }
public _Mark_PolyBeam(TSD.Mark mark, TSM.ModelObject part, TSD.ModelObject dr, TSD.ViewBase vv) : base(mark, part, dr, vv) { }
public _Mark_ContourPlate(TSD.Mark mark, TSM.ModelObject part, TSD.ModelObject dr, TSD.ViewBase vv) : base(mark, part, dr, vv) { }
public void addOneObject(TSD.DrawingObject dro) { if (dro is TSD.Mark) { TSD.Mark current = dro as TSD.Mark; markHandler(current); } else if (dro is TSD.StraightDimensionSet) { TSD.StraightDimensionSet current = dro as TSD.StraightDimensionSet; _StraightDimentionSet temp = new _StraightDimentionSet(current); straightDimSets.Add(temp); } else if (dro is TSD.SectionMark) { TSD.SectionMark current = dro as TSD.SectionMark; _SectionMark temp = new _SectionMark(current); sectionMarks.Add(temp); } else if (dro is TSD.DetailMark) { TSD.DetailMark current = dro as TSD.DetailMark; detailMarks.Add(current); } else if (dro is TSD.Text) { TSD.Text current = dro as TSD.Text; txt.Add(current); } else if (dro is TSD.Arc) { TSD.Arc current = dro as TSD.Arc; arcs.Add(current); } else if (dro is TSD.Line) { TSD.Line current = dro as TSD.Line; lines.Add(current); } else if (dro is TSD.Polyline) { TSD.Polyline current = dro as TSD.Polyline; polylines.Add(current); } else if (dro is TSD.Circle) { TSD.Circle current = dro as TSD.Circle; circles.Add(current); } else if (dro is TSD.Cloud) { TSD.Cloud current = dro as TSD.Cloud; clouds.Add(current); } else if (dro is TSD.Rectangle) { TSD.Rectangle current = dro as TSD.Rectangle; rectangles.Add(current); } else if (dro is TSD.Polygon) { TSD.Polygon current = dro as TSD.Polygon; polygons.Add(current); } else if (dro is TSD.TextFile) { TSD.TextFile current = dro as TSD.TextFile; txtFiles.Add(current); } else if (dro is TSD.DwgObject) { TSD.DwgObject current = dro as TSD.DwgObject; dwgRefs.Add(current); } }
private void markHandler(TSD.Mark currentMark) { if (currentMark.Attributes.Content.Count > 0) { System.Type[] Types = new System.Type[1]; Types.SetValue(typeof(TSD.ModelObject), 0); TSD.DrawingObjectEnumerator markObjects = currentMark.GetRelatedObjects(Types); foreach (TSD.ModelObject currentDO in markObjects) { TSM.Model myModel = new TSM.Model(); TSM.ModelObject modelObject = myModel.SelectModelObject(currentDO.ModelIdentifier); if (modelObject != null) { if (modelObject is TSM.Beam) { TSM.Beam currentMO = modelObject as TSM.Beam; markBeams.Add(new _Mark_Beam(currentMark, currentMO, currentDO, this.view)); } else if (modelObject is TSM.PolyBeam) { TSM.PolyBeam currentMO = modelObject as TSM.PolyBeam; markPolyBeams.Add(new _Mark_PolyBeam(currentMark, currentMO, currentDO, this.view)); } else if (modelObject is TSM.ContourPlate) { TSM.ContourPlate currentMO = modelObject as TSM.ContourPlate; markContourPlates.Add(new _Mark_ContourPlate(currentMark, currentMO, currentDO, this.view)); } else if (modelObject is TSM.SingleRebar) { TSM.SingleRebar currentMO = modelObject as TSM.SingleRebar; markSingleRebars.Add(new _Mark_SingleRebar(currentMark, currentMO, currentDO, this.view)); } else if (modelObject is TSM.RebarGroup) { TSM.BaseRebarGroup currentMO = modelObject as TSM.RebarGroup; markRebarBases.Add(new _Mark_RebarGroup(currentMark, currentMO, currentDO, this.view)); } else if (modelObject is TSM.BoltGroup) { TSM.BoltGroup currentMO = modelObject as TSM.BoltGroup; markBoltGroup.Add(new _Mark_BoltGroup(currentMark, currentMO, currentDO, this.view)); } } } } }