public void add_one(Raud one) { _array.Add(one); int index = (int)_array.Count / 2; _IP = _array[index].IP; }
private void keep(R.Raud reinf, G.Edge edge, G.Corner corner1, G.Corner corner2) { if (edge != null) { if (!setEdges.Keys.Contains(edge)) { setEdges[edge] = reinf; } } if (corner1 != null) { if (!setCorners.Keys.Contains(corner1)) { setCorners[corner1] = reinf; } } if (corner2 != null) { if (!setCorners.Keys.Contains(corner2)) { setCorners[corner2] = reinf; } } knownReinforcement.Add(reinf); }
private void keep_replace(R.Raud n1, R.Raud n2, R.Raud old1, R.Raud old2) { ReplaceByValue(setEdges, old1, n1); ReplaceByValue(setEdges, old2, n1); ReplaceByValue(setCorners, old1, n2); ReplaceByValue(setCorners, old2, n2); for (int i = knownReinforcement.Count - 1; i >= 0; i--) { if (ReferenceEquals(knownReinforcement[i], old1)) { knownReinforcement.RemoveAt(i); } } for (int i = knownReinforcement.Count - 1; i >= 0; i--) { if (ReferenceEquals(knownReinforcement[i], old2)) { knownReinforcement.RemoveAt(i); } } knownReinforcement.Add(n1); knownReinforcement.Add(n2); }
private string getBendingBlockName(R.Raud _ALFA_) { if (_ALFA_ is R.A_Raud) { return("Raud_A"); } else if (_ALFA_ is R.B_Raud) { return("Raud_B"); } else if (_ALFA_ is R.C_Raud) { return("Raud_C"); } else if (_ALFA_ is R.D_Raud) { return("Raud_D"); } else if (_ALFA_ is R.E_Raud) { return("Raud_E"); } else if (_ALFA_ is R.U_Raud) { return("Raud_U"); } else { return("Raud_A"); } }
private void keep_array(R.Raud reinf, LineSegment ls) { if (ls != null) { if (!setLineSegment.Contains(ls)) { setLineSegment.Add(ls); } } }
private void keep_double(R.Raud reinf, G.Edge edge) { if (edge != null) { if (!setEdges.Keys.Contains(edge)) { setEdges[edge] = reinf; } } }
private void keep_remove(R.Raud a) { RemoveByValue(setEdges, a); RemoveByValue(setCorners, a); for (int i = knownReinforcement.Count - 1; i >= 0; i--) { if (ReferenceEquals(knownReinforcement[i], a)) { knownReinforcement.RemoveAt(i); } } }
public override bool Equals(Raud obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } if (obj.GetType() != GetType()) { return(false); } return(Equals(obj as A_Raud)); }
private void insertReinforcementSingle(R.Raud _ALFA_, bool arrayReinf) { string layerName = "Armatuur"; string blockName = getReinforcementBlockName(_ALFA_, arrayReinf); _Ge.Point3d insertPointBlock = new _Ge.Point3d(_ALFA_.StartPoint.X, _ALFA_.StartPoint.Y, 0); using (_Db.BlockReference newBlockReference = new _Db.BlockReference(insertPointBlock, _c.blockTable[blockName])) { newBlockReference.Rotation = _ALFA_.Rotation; newBlockReference.Layer = layerName; _c.modelSpace.AppendEntity(newBlockReference); _c.trans.AddNewlyCreatedDBObject(newBlockReference, true); setReinforcementBlockParameters(newBlockReference, _ALFA_); } }
private string getReinforcementBlockName(R.Raud _ALFA_, bool arrayReinf) { if (arrayReinf == false) { if (_ALFA_ is R.A_Raud) { return("Reinf_A_Raud"); } else if (_ALFA_ is R.B_Raud) { return("Reinf_B_Raud"); } else if (_ALFA_ is R.C_Raud) { return("Reinf_C_Raud"); } else if (_ALFA_ is R.D_Raud) { return("Reinf_D_Raud"); } else if (_ALFA_ is R.E_Raud) { return("Reinf_E_Raud2"); } } else { if (_ALFA_ is R.A_Raud) { return("Reinf_A_Raud"); } else if (_ALFA_ is R.D_Raud) { return("Reinf_D_Raud_Side"); } else if (_ALFA_ is R.U_Raud) { return("Reinf_U_Raud_Side"); } } return("Reinf_A_Raud"); }
private void insertBending(R.Raud _ALFA_, G.Point insertion) { string layerName = "K023TL"; string blockName = getBendingBlockName(_ALFA_); _Ge.Point3d insertPointBlock = new _Ge.Point3d(insertion.X, insertion.Y, 0); using (_Db.BlockReference newBlockReference = new _Db.BlockReference(insertPointBlock, _c.blockTable[blockName])) { newBlockReference.Layer = layerName; _c.modelSpace.AppendEntity(newBlockReference); _c.trans.AddNewlyCreatedDBObject(newBlockReference, true); newBlockReference.TransformBy(_Ge.Matrix3d.Scaling(L._V_.Z_DRAWING_SCALE, insertPointBlock)); _Db.BlockTableRecord blockBlockTable = _c.trans.GetObject(_c.blockTable[blockName], _Db.OpenMode.ForRead) as _Db.BlockTableRecord; if (blockBlockTable.HasAttributeDefinitions) { foreach (_Db.ObjectId objID in blockBlockTable) { _Db.DBObject obj = _c.trans.GetObject(objID, _Db.OpenMode.ForRead) as _Db.DBObject; if (obj is _Db.AttributeDefinition) { _Db.AttributeDefinition attDef = obj as _Db.AttributeDefinition; if (!attDef.Constant) { using (_Db.AttributeReference attRef = new _Db.AttributeReference()) { attRef.SetAttributeFromBlock(attDef, newBlockReference.BlockTransform); attRef.Position = attDef.Position.TransformBy(newBlockReference.BlockTransform); setBendingBlockParameters(attRef, _ALFA_); newBlockReference.AttributeCollection.AppendAttribute(attRef); _c.trans.AddNewlyCreatedDBObject(attRef, true); } } } } } } }
private void setBendingBlockParameters(_Db.AttributeReference ar, R.Raud _ALFA_) { if (ar != null) { if (ar.Tag == "Teraseklass") { ar.TextString = _ALFA_.Materjal.ToString(); } if (ar.Tag == "Positsioon") { ar.TextString = _ALFA_.ToStringNoCount(); } if (_ALFA_ is R.A_Raud) { R.A_Raud _BETA_ = _ALFA_ as R.A_Raud; if (ar.Tag == "A") { ar.TextString = _BETA_.A.ToString(); } } if (_ALFA_ is R.B_Raud) { R.B_Raud _BETA_ = _ALFA_ as R.B_Raud; if (ar.Tag == "A") { ar.TextString = _BETA_.A.ToString(); } else if (ar.Tag == "B") { ar.TextString = _BETA_.B.ToString(); } } if (_ALFA_ is R.C_Raud) { R.C_Raud _BETA_ = _ALFA_ as R.C_Raud; if (ar.Tag == "A") { ar.TextString = _BETA_.A.ToString(); } else if (ar.Tag == "B") { ar.TextString = _BETA_.B.ToString(); } else if (ar.Tag == "U") { ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString(); } } if (_ALFA_ is R.D_Raud) { R.D_Raud _BETA_ = _ALFA_ as R.D_Raud; if (ar.Tag == "A") { ar.TextString = _BETA_.A.ToString(); } else if (ar.Tag == "B") { ar.TextString = _BETA_.B2.ToString(); // parand magic } else if (ar.Tag == "C") { ar.TextString = _BETA_.C.ToString(); } } if (_ALFA_ is R.E_Raud) { R.E_Raud _BETA_ = _ALFA_ as R.E_Raud; if (ar.Tag == "A") { ar.TextString = _BETA_.A.ToString(); } else if (ar.Tag == "B") { ar.TextString = _BETA_.B2.ToString(); // parand magic } else if (ar.Tag == "C") { ar.TextString = _BETA_.C.ToString(); } else if (ar.Tag == "U") { ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString(); } else if (ar.Tag == "V") { ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.V), 0)).ToString(); } else if (ar.Tag == "X") { ar.TextString = ((int)_BETA_.X).ToString(); } else if (ar.Tag == "Y") { ar.TextString = ((int)_BETA_.Y).ToString(); } } if (_ALFA_ is R.U_Raud) { R.U_Raud _BETA_ = _ALFA_ as R.U_Raud; if (ar.Tag == "A") { ar.TextString = _BETA_.A.ToString(); } else if (ar.Tag == "B") { ar.TextString = _BETA_.B.ToString(); } else if (ar.Tag == "C") { ar.TextString = _BETA_.C.ToString(); } } } }
private void setReinforcementBlockParameters(_Db.BlockReference newBlockReference, R.Raud _ALFA_) { _Db.DynamicBlockReferencePropertyCollection aa = newBlockReference.DynamicBlockReferencePropertyCollection; foreach (_Db.DynamicBlockReferenceProperty a in aa) { if (a != null) { if (_ALFA_ is R.A_Raud) { R.A_Raud _BETA_ = _ALFA_ as R.A_Raud; if (a.PropertyName == "A") { a.Value = _BETA_.A; } } else if (_ALFA_ is R.B_Raud) { R.B_Raud _BETA_ = _ALFA_ as R.B_Raud; if (a.PropertyName == "A") { a.Value = _BETA_.A; } else if (a.PropertyName == "B") { a.Value = _BETA_.B; } } else if (_ALFA_ is R.C_Raud) { R.C_Raud _BETA_ = _ALFA_ as R.C_Raud; if (a.PropertyName == "A") { a.Value = _BETA_.A; } else if (a.PropertyName == "B") { a.Value = _BETA_.B; } else if (a.PropertyName == "U") { a.Value = Math.PI - _BETA_.U; // HERE } } else if (_ALFA_ is R.D_Raud) { R.D_Raud _BETA_ = _ALFA_ as R.D_Raud; if (a.PropertyName == "A") { a.Value = _BETA_.A; } else if (a.PropertyName == "B") { a.Value = _BETA_.B; } else if (a.PropertyName == "C") { a.Value = _BETA_.C; } else if (a.PropertyName == "A/C") { a.Value = _BETA_.A; } } else if (_ALFA_ is R.E_Raud) { R.E_Raud _BETA_ = _ALFA_ as R.E_Raud; if (a.PropertyName == "A") { a.Value = _BETA_.A; } else if (a.PropertyName == "B") { a.Value = _BETA_.B; } else if (a.PropertyName == "C") { a.Value = _BETA_.C; } else if (a.PropertyName == "U") { a.Value = Math.PI - _BETA_.U; // HERE } else if (a.PropertyName == "V") { if (_BETA_.B > 6000) { a.Value = _BETA_.V + Math.PI; } else { a.Value = _BETA_.V; } } else if (a.PropertyName == "X") { a.Value = _BETA_.X; } else if (a.PropertyName == "Y") { a.Value = _BETA_.Y; } } else if (_ALFA_ is R.U_Raud) { R.U_Raud _BETA_ = _ALFA_ as R.U_Raud; if (a.PropertyName == "A") { a.Value = _BETA_.A; } else if (a.PropertyName == "B") { a.Value = _BETA_.B; } else if (a.PropertyName == "C") { a.Value = _BETA_.C; } } } } }