public static __DrawingData getSelectedData() { __DrawingData drawing = new __DrawingData(); TSD.DrawingHandler drawingHandler = new TSD.DrawingHandler(); if (drawingHandler.GetConnectionStatus()) { TSD.ContainerView sheet = drawingHandler.GetActiveDrawing().GetSheet(); try { getPoint(drawing); } catch { drawing.setSheet(sheet); } TSD.DrawingObjectEnumerator selectedObjects = drawingHandler.GetDrawingObjectSelector().GetSelected(); drawing.populate(selectedObjects); } return(drawing); }
internal void getDimSetPoints() { TSD.DrawingObjectEnumerator dima = _set.GetObjects(); while (dima.MoveNext()) { TSD.StraightDimension line = dima.Current as TSD.StraightDimension; if (_first == null) { _first = line; } addUniquePoints(line.StartPoint); addUniquePoints(line.EndPoint); } }
public void populate(TSD.DrawingObjectEnumerator all) { int i = 0; int tot = all.GetSize(); MainForm._form.replace_text("Total objects to proccess: " + tot.ToString()); foreach (TSD.DrawingObject one in all) { i++; MainForm._form.replace_text("Proccessing: " + i.ToString() + " of " + tot.ToString()); if (one is TSD.Mark || one is TSD.StraightDimensionSet || one is TSD.SectionMark || one is TSD.DetailMark || one is TSD.Text || //one is TSD.Arc || one is TSD.Line || one is TSD.Polyline || one is TSD.Circle || one is TSD.Cloud || one is TSD.Rectangle || one is TSD.Polygon || one is TSD.TextFile || one is TSD.DwgObject) { TSD.ViewBase oneView = one.GetView(); foreach (TSD.ViewBase stored in data.Keys) { if (stored.IsSameDatabaseObject(oneView)) { data[stored].addOneObject(one); break; } } } } MainForm._form.add_text(String.Empty); }
public static double getHighestScale(TSD.Drawing currentDrawing) { double highestScale = 0; TSD.DrawingObjectEnumerator ViewEnum = currentDrawing.GetSheet().GetViews(); while (ViewEnum.MoveNext()) { if (ViewEnum.Current is TSD.View) { TSD.View currentView = ViewEnum.Current as TSD.View; if (isView2D(currentView)) { double currentScale = currentView.Attributes.Scale; highestScale = Math.Max(currentScale, highestScale); } } } MainWindow._form.consoleOutput("EXPORT - Scale: " + highestScale.ToString(), "L2"); return(highestScale); }
public static __DrawingData getAllData() { __DrawingData drawing = new __DrawingData(); TSD.DrawingHandler drawingHandler = new TSD.DrawingHandler(); if (drawingHandler.GetConnectionStatus()) { TSD.ContainerView sheet = drawingHandler.GetActiveDrawing().GetSheet(); try { getPoint(drawing); } catch { drawing.setSheet(sheet); } List <Type> types = new List <Type>(); if (UserProperties._mark) { types.Add(typeof(TSD.Mark)); } if (UserProperties._section) { types.Add(typeof(TSD.SectionMark)); } if (UserProperties._detail) { types.Add(typeof(TSD.DetailMark)); } //if (UserProperties._line) types.Add(typeof(TSD.Arc)); PUUDUB PIISAV INFO if (UserProperties._line) { types.Add(typeof(TSD.Line)); } if (UserProperties._line) { types.Add(typeof(TSD.Polyline)); } if (UserProperties._line) { types.Add(typeof(TSD.Circle)); } if (UserProperties._line) { types.Add(typeof(TSD.Cloud)); } if (UserProperties._line) { types.Add(typeof(TSD.Rectangle)); } if (UserProperties._line) { types.Add(typeof(TSD.Polygon)); } if (UserProperties._dim) { types.Add(typeof(TSD.StraightDimensionSet)); } if (UserProperties._txt) { types.Add(typeof(TSD.Text)); } if (UserProperties._txtfile) { types.Add(typeof(TSD.TextFile)); } if (UserProperties._dwg) { types.Add(typeof(TSD.DwgObject)); } if (types.Count != 0) { System.Type[] Types = new System.Type[types.Count]; for (int i = 0; i < types.Count; i++) { Types.SetValue(types[i], i); } TSD.DrawingObjectEnumerator allObjects = sheet.GetAllObjects(Types); drawing.populate(allObjects); } } return(drawing); }
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)); } } } } }