testVolTable(int numSteps = 0, double incre = 0, short clrStart = 100) { TinVolumeSurface objSurfaceVOL = Surf.getTinVolumeSurface("wse"); double minElev = objSurfaceVOL.GetGeneralProperties().MinimumElevation; double maxElev = objSurfaceVOL.GetGeneralProperties().MaximumElevation; if (incre == 0) { incre = (maxElev - minElev) / numSteps; } if (numSteps == 0) { numSteps = (int)((maxElev - minElev) / incre); } SurfaceAnalysisElevationData[] objSurfaceAnalysisElevation = new SurfaceAnalysisElevationData[numSteps]; for (int i = 0; i < numSteps; i++) { Color clr = Color.FromColorIndex(ColorMethod.ByLayer, (short)(clrStart + (i * 2))); objSurfaceAnalysisElevation[i] = new SurfaceAnalysisElevationData(minElev + (incre * i), minElev + (incre * (i + 1)), clr); } objSurfaceVOL.Analysis.SetElevationData(objSurfaceAnalysisElevation); }
public static void updateSurfaces() { try { Grading_Palette.gPalette.pGrading.BlockXRefName = String.Empty; Grading_Palette.gPalette.pGrading.Initialize_Form(); myForms.GradeFloor pGF = Grading_Palette.gPalette.pGradeFloor; pGF.lstBox1.Items.Clear(); List <string> surfaces = Surf.getSurfaces(); if (surfaces != null) { for (int i = 0; i < surfaces.Count; i++) { pGF.lstBox1.Items.Add(surfaces[i].ToUpper()); if (surfaces[i].ToUpper() == "EXIST") { pGF.lstBox1.SelectedIndex = i; } } } } catch (System.Exception ex) { BaseObjs.writeDebug(ex.Message + " Grading_Utility.cs: line: 543"); } }
public frmMain() { InitializeComponent(); cbxB2.Checked = true; cbxB1.Checked = true; tbxB2Width.Text = Convert.ToString(2); tbxB1Width.Text = Convert.ToString(2); tbxB2Slope.Text = Convert.ToString(.02); tbxB1Slope.Text = Convert.ToString(.02); tbxSlope.Text = Convert.ToString(2); tbxInterval.Text = Convert.ToString(10); try { List <string> Surfaces = Surf.getSurfaces(); foreach (string Name in Surfaces) { lbxSurfaceDES.Items.Add(Name); lbxSurfaceTAR.Items.Add(Name); } } catch (SystemException) { } }
Initialize_Form() { optSetElevByDiff.IsChecked = false; int index = 0; List <string> surfaces = Surf.getSurfaces(); lstBox1.Items.Clear(); if (surfaces != null) { for (int i = 0; i < surfaces.Count; i++) { string surface = surfaces[i]; if (surface.Length < 15) { lstBox1.Items.Add(surface); if (surface.ToUpper() == "EXIST") { index = i; } } } lstBox1.SelectedIndex = index; } cmbSlope.Items.Clear(); cmbSlope.Items.Add(0.000); cmbSlope.Items.Add(0.001); cmbSlope.Items.Add(0.002); cmbSlope.Items.Add(0.003); cmbSlope.Items.Add(0.004); cmbSlope.Items.Add(0.005); cmbSlope.SelectedValue = "0.000"; cmbSlope.SelectedIndex = 0; }
makeProfile(ObjectId idAlign) { Point3d pnt3dPick = Pub.pnt3dO; if (idAlign == ObjectId.Null) { Autodesk.AutoCAD.DatabaseServices.Entity ent = Select.selectEntity(typeof(Alignment), "\nSelect Alignment: ", "\nSelected object was not an alignment. Try again: ", out pnt3dPick); idAlign = ent.ObjectId; } bool exists = false; ProfileView pView = null; using (BaseObjs._acadDoc.LockDocument()) { TinSurface tinSurf = Surf.getTinSurface("EXIST", out exists); string nameProfile = tinSurf.Name; Profile profEX = Prof.addProfileBySurface(nameProfile, idAlign, tinSurf.ObjectId, fMNP.idLayer, fMNP.idProfileStyleEX, fMNP.idProfileLabelSetEX); tinSurf = Surf.getTinSurface("CPNT-ON", out exists); nameProfile = tinSurf.Name; Profile profDE = Prof.addProfileBySurface(nameProfile, idAlign, tinSurf.ObjectId, fMNP.idLayer, fMNP.idProfileStyleDE, fMNP.idProfileLabelSetDE); fMNP.idProfile = profDE.ObjectId; PromptStatus ps; pnt3dPick = UserInput.getPoint("Select insertion point for Profile View", out ps, osMode: 0); pView = Prof.addProfileView(idAlign, pnt3dPick, fMNP.idProfileBandSetStyle, fMNP.idProfileViewStyle); } return(pView.ObjectId); }
addBreaklines2Surface(ObjectId[] ids = null, string nameSurface = null) { SelectionSet ss = null; if (ids == null) { TypedValue[] tvs = new TypedValue[1]; tvs[0] = new TypedValue((int)DxfCode.Start, "POLYLINE"); ss = Select.buildSSetBase(tvs, false); if (ss.Count > 0) { ids = ss.GetObjectIds(); } ObjectId idTinSurf = ObjectId.Null; bool exists; if (nameSurface == null) { string nameDwg = BaseObjs.docName; if (nameDwg.Contains("CGP")) { idTinSurf = Surf.getSurface("CPNT-ON", out exists); nameSurface = "CPNT-ON"; } else if (nameDwg.Contains("GCAL")) { idTinSurf = Surf.getSurface("CPNT-ON", out exists); nameSurface = "CPNT-ON"; } else if (nameDwg.Contains("MASS")) { idTinSurf = Surf.getSurface("CPNT-ON", out exists); nameSurface = "CPNT-ON"; } else if (nameDwg.Contains("CONT")) { idTinSurf = Surf.getSurface("EXIST", out exists); nameSurface = "EXIST"; } } else { idTinSurf = Surf.getSurface(nameSurface, out exists); } ObjectIdCollection idColl = new ObjectIdCollection(); foreach (ObjectId id in ids) { idColl.Add(id); } TinSurface tinSurf = (TinSurface)idTinSurf.getEnt(); tinSurf.BreaklinesDefinition.AddStandardBreaklines(idColl, 1.0, 0, 0, 0); } }
updateSpreadsheet(ref double dblVolFill, ref double dblVolCut) { string strPath = BaseObjs.docFullName; string strJN = BaseObjs.jobNumber(); string strFN = string.Format("{0}EW.xlsx", strJN); string strFullPath = strPath + "\\" + strFN; SelectionSet objSSet = EW_Utility1.buildSSet22(); if ((dblVolFill == 0)) { bool exists; ObjectId idSurfaceCUT = Surf.getSurface("VOL_EXIST_BOT", out exists); ObjectId idSurfaceFILL = Surf.getSurface("VOL_BOT_SG", out exists); TinVolumeSurface objSurfaceFILL = (TinVolumeSurface)idSurfaceFILL.getEnt(); TinVolumeSurface objSurfaceCUT = (TinVolumeSurface)idSurfaceCUT.getEnt(); dblVolCut = objSurfaceFILL.GetVolumeProperties().UnadjustedCutVolume / 27; dblVolFill = objSurfaceFILL.GetVolumeProperties().UnadjustedFillVolume / 27; dblVolCut = dblVolCut + objSurfaceCUT.GetVolumeProperties().UnadjustedCutVolume / 27; dblVolFill = dblVolFill + objSurfaceCUT.GetVolumeProperties().UnadjustedFillVolume / 27; } if (spreadSheetExists(strFullPath, dblVolFill, dblVolCut)) { Excel_ext excl = new Excel_ext(true); excl.OpenFile(strFullPath, ""); excl.FindExcelWorksheet("SUMMARY"); Excel._Worksheet objWS = excl.excelWrkSht; objWS.Range["SUMMARY!volCUT"].Value = dblVolCut; objWS.Range["SUMMARY!volFILL"].Value = dblVolFill; //objWS.Range["SUMMARY!AREA_BLDG"].Value = 0; excl.CloseFile(true, strFullPath, false); excl.excelAPP.Quit(); } else { MessageBox.Show("Error copying EW spreadsheet"); } objSSet = EW_Utility1.buildSSet8(); if (objSSet != null && objSSet.Count > 0) { ObjectId[] ids = objSSet.GetObjectIds(); for (int i = 0; i < ids.Length; i++) { ids[i].delete(); } } setupSpreadSheetMS(dblVolFill, dblVolCut); }
private void wSurfaces_Activated(object sender, EventArgs e) { List <string> surfaces = Surf.getSurfaces(); foreach (string surface in surfaces) { this.lbxBase.Items.Add(surface); this.lbxComp.Items.Add(surface); } }
deleteBreaklinesInSurface(string nameSurface) { bool exists = false; TinSurface surf = Surf.getTinSurface(nameSurface, out exists); if (exists) { surf.deleteBreaklines(); } }
/// <summary> /// pasandole el nombre se retornan las clases hija a utilizar /// </summary> /// <param name="NombreAtaque"></param> /// <returns></returns> public static AttacksBase EncontrarAtaques(string NombreAtaque) { AttacksBase ClaseARetornar = null; switch (NombreAtaque) { case "Barrida": ClaseARetornar = new ataqueBarrida(); break; case "Disp de Energia": ClaseARetornar = new DisparoEnergia(); break; case "Esquive": ClaseARetornar = new Esquive(); break; case "Triple Impacto": ClaseARetornar = new TripleImpacto(); break; case "PInchosVenenoso": ClaseARetornar = new PInchosVenenoso(); break; case "Cura": ClaseARetornar = new Cura(); break; case "Adsorver": ClaseARetornar = new Adsorver(); break; case "Ataque Electrico": ClaseARetornar = new AtaqueElectrico(); break; case "Mega puño": ClaseARetornar = new MegaPuño(); break; case "Surf": ClaseARetornar = new Surf(); break; default: Debug.Log("no se ha Ataque:" + NombreAtaque + " Corregir o no existe"); Debug.Break(); break; } return(ClaseARetornar); }
public frmSurfaces() { InitializeComponent(); List <string> surfaces = Surf.getSurfaces(); foreach (string surface in surfaces) { this.lboxBASE.Items.Add(surface); this.lboxCOMP.Items.Add(surface); } }
makeVolSurface(string strNameBASE, string strNameCOMP, bool boolShowMessage) { string nameSurface = string.Format("VOL_{0}_{1}", strNameBASE, strNameCOMP); List <string> nameSurfaces = Surf.getSurfaces(); for (int i = 0; i < nameSurfaces.Count; i++) { if (nameSurfaces[i] == nameSurface) { Surf.removeSurface(nameSurfaces[i]); } } TinSurface objSurfaceBASE = Surf.getTinSurface(strNameBASE); TinSurface objSurfaceCOMP = Surf.getTinSurface(strNameCOMP); int lngVolCut = 0; int lngVolFill = 0; ObjectId idSurfFill = TinVolumeSurface.Create(nameSurface, objSurfaceBASE.ObjectId, objSurfaceCOMP.ObjectId); SelectionSet objSSetLim = EW_Utility1.buildSSetGradingLim(); ObjectId[] ids = objSSetLim.GetObjectIds(); TinVolumeSurface objSurfaceFILL = null; if (ids != null && ids.Length > 0) { ObjectId idPoly = ids[0]; idPoly.checkIfClosed(); ObjectId idPoly3d = Conv.poly_Poly3d(idPoly, 0, "0"); ObjectId[] idBndrys = { idPoly3d }; objSurfaceFILL = (TinVolumeSurface)idSurfFill.getEnt(); objSurfaceFILL.BoundariesDefinition.AddBoundaries(new ObjectIdCollection(idBndrys), 1.0, Autodesk.Civil.SurfaceBoundaryType.Outer, true); objSurfaceFILL.Rebuild(); idPoly3d.delete(); } else { MessageBox.Show("GRADING LIMIT not found - OUTER BOUNDARY not added."); } lngVolCut = (int)objSurfaceFILL.GetVolumeProperties().UnadjustedCutVolume / 27; lngVolFill = (int)objSurfaceFILL.GetVolumeProperties().UnadjustedFillVolume / 27; if (boolShowMessage == true) { string mess = string.Format("Cut: {0} CY Fill: {1} CY", lngVolCut, lngVolFill); MessageBox.Show(mess); } EW_Main.viewResults("VOL", false); }
public static void processPoints(SelectionSet objSSet, List <Point3d> varPntsLeader) { winPadCerts wPadCerts = PC_Forms.pcForm.wPadCerts; int k = varPntsLeader.Count; List <double> dx = new List <double>(); List <double> dy = new List <double>(); for (int i = 1; i < k; i++) { dx.Add(varPntsLeader[i].X - varPntsLeader[i - 1].X); dy.Add(varPntsLeader[i].Y - varPntsLeader[i - 1].Y); } double dblDir = varPntsLeader[k - 2].getDirection(varPntsLeader[k - 1]); string strName = System.Convert.ToString(wPadCerts.lbxSurfaceName.SelectedItem); TinSurface objSurface = Surf.getTinSurface(strName); ObjectId[] ids = objSSet.GetObjectIds(); for (int i = 0; i < ids.Length; i++) { List <Point3d> pnts3dLdr = new List <Point3d>(); Point3d pnt3d = ids[i].getCogoPntCoordinates(); double dblElevPnt = pnt3d.Z; pnts3dLdr.Add(new Point3d(pnt3d.X, pnt3d.Y, 0)); for (int j = 0; j < dx.Count; j++) { pnt3d = new Point3d(pnt3d.X + dx[j], pnt3d.Y + dy[j], 0); pnts3dLdr.Add(pnt3d); } Point3d pnt3dInsTxt = pnt3d; double dblElevSurface = objSurface.FindElevationAtXY(pnts3dLdr[0].X, pnts3dLdr[0].Y); if (wPadCerts.optBase.IsChecked == true) { dblElevSurface = dblElevSurface + (System.Convert.ToDouble(wPadCerts.tbxPvmtThickness.Text)) / 12; } else if (wPadCerts.optSG.IsChecked == true) { dblElevSurface = dblElevSurface + (System.Convert.ToDouble(wPadCerts.tbxTotalSection.Text)) / 12; } PacCerts.PC_LblElevDiff.labelElevDiff(dblElevPnt, dblElevSurface, pnts3dLdr, pnt3dInsTxt, dblDir); } }
makeSurface(string strSurfaceName) { SelectionSet objSSet = EW_Utility1.buildSSet2a(strSurfaceName); if (objSSet == null || objSSet.Count == 0) { return; } ObjectId[] ids = objSSet.GetObjectIds(); ObjectIdCollection idsBrks = new ObjectIdCollection(); foreach (ObjectId id in ids) { idsBrks.Add(id); } EW_CheckSurfaceStyles.checkSurfaceStyles(strSurfaceName); TinSurface objSurface = Surf.getTinSurface(strSurfaceName); if (objSurface == null) { return; } objSurface.ObjectId.delete(); objSurface = Surf.addTinSurface(strSurfaceName, out exists); objSurface.BreaklinesDefinition.AddStandardBreaklines(idsBrks, 1.0, 0, 0, 0); objSurface.BuildOptions.CrossingBreaklinesElevationOption = Autodesk.Civil.CrossingBreaklinesElevationType.UseAverage; SelectionSet objSSetLim = EW_Utility1.buildSSetGradingLim(); if (objSSetLim.Count == 0) { MessageBox.Show("GRADING LIMIT not found - OUTER BOUNDARY not added."); return; } ObjectId idLWPline = objSSetLim.GetObjectIds()[0]; Conv.processBndry(idLWPline); ObjectId[] id3dPoly = { Conv.poly_Poly3d(idLWPline, 0, "0") }; objSurface.BoundariesDefinition.AddBoundaries(new ObjectIdCollection(id3dPoly), 1.0, Autodesk.Civil.SurfaceBoundaryType.Outer, true); objSurface.Rebuild(); id3dPoly[0].delete(); }
modSurface(string nameSurface, string descSurface, ObjectIdCollection idsPoly3d, bool boolNewSurface) { bool exists = false; TinSurface objSurface = Surf.getTinSurface(nameSurface, out exists); if (!exists) { objSurface.StyleId = Surf_Styles.getSurfaceStyle(nameSurface); } objSurface.BreaklinesDefinition.AddStandardBreaklines(idsPoly3d, 1, 0, 0, 0); objSurface.BuildOptions.CrossingBreaklinesElevationOption = Autodesk.Civil.CrossingBreaklinesElevationType.UseAverage; objSurface.Rebuild(); }
makeBotSurfaceGrid(int intInterval, int i1) { App.SetSystemVariable("PDSISE", 0.01); setPointStyleBOT(); setPointLabelStyleBOT(); bool exists; TinSurface objSurfaceCPNT_ON = Surf.getTinSurface("CPNT-ON", out exists); Object[] varLimits = EW_Utility2.getLimits(intInterval); double dblPntXmin = (double)varLimits[0]; double dblPntYmin = (double)varLimits[1]; int iMax = (int)varLimits[2]; int jMax = (int)varLimits[3]; for (int j = 0; j <= jMax; j++) { double dblY = dblPntYmin + (j * intInterval); for (int i = 0; i <= iMax; i++) { double dblX = dblPntXmin + (i * intInterval); double dblZ_OX = objSurfaceCPNT_ON.FindElevationAtXY(dblX, dblY); if (dblZ_OX > 0) //point is inside OX boundary { Point3d dblPnt = new Point3d(dblX, dblY, dblZ_OX); ObjectId idCivilPnt = dblPnt.setPoint("GRID-POINTS"); } } } TypedValue[] tvs = new TypedValue[4] { new TypedValue(1001, "BOT"), new TypedValue(1040, varLimits[0]), new TypedValue(1040, varLimits[1]), new TypedValue(1070, intInterval) }; ObjectId idDictBOT = Dict.getNamedDictionary("BOT", out exists); idDictBOT.setXData(tvs, "BOT"); return(varLimits); }
checkBldgElev(string strAlignName) { TinSurface objSurface = null; bool exists = false; try { ObjectId idLayer = Layer.manageLayers(fStake.GCAL_LAYER); BaseObjs.regen(); } catch (System.Exception) { Stake_GetSurfaceCPNT.getSurfaceFromXRef("STAKE", "STAKE"); objSurface = Surf.getTinSurface("CPNT-ON", out exists); } Alignment objAlign = Align.getAlignment(strAlignName); string.Format("\"Test Building No. {0} :\n", strAlignName); Form.ControlCollection objCntrls = default(Form.ControlCollection); Control objCntrl = default(Control); if (checkBldgElevs(objAlign.ObjectId)) { objCntrls = (Form.ControlCollection)fGrid.Frame08.Controls; objCntrl = objCntrls[strAlignName]; objCntrl.BackgroundImage = System.Drawing.Image.FromFile("R:\\TSET\\VBA\\CHECK.bmp"); objCntrls = (Form.ControlCollection)fGrid.Frame10.Controls; objCntrl = objCntrls[string.Format("cmd{0}", strAlignName.Substring(5))]; objCntrl.Enabled = true; } else { objCntrls = (Form.ControlCollection)fGrid.Frame08.Controls; objCntrl = objCntrls[strAlignName]; objCntrl.BackgroundImage = System.Drawing.Image.FromFile("R:\\TSET\\VBA\\X.bmp"); objCntrls = (Form.ControlCollection)fGrid.Frame10.Controls; objCntrl = objCntrls[string.Format("cmd{0}", strAlignName.Substring(5))]; objCntrl.Enabled = false; } }
public override void Apply(CrtSequence crtSequence) { if (!(crtSequence.ChartType is Surf)) { throw new Exception("Invalid chart type"); } Surf surf = crtSequence.ChartType as Surf; // c:surfaceChart _writer.WriteStartElement(Dml.Chart.Prefix, this._is3DChart ? Dml.Chart.ElSurface3DChart : Dml.Chart.ElSurfaceChart, Dml.Chart.Ns); { // EG_SurfaceChartShared // c:wireframe // Surface Chart Series (CT_SurfaceSer) foreach (SeriesFormatSequence seriesFormatSequence in this.ChartFormatsSequence.SeriesFormatSequences) { if (seriesFormatSequence.SerToCrt != null && seriesFormatSequence.SerToCrt.id == crtSequence.ChartFormat.idx) { // c:ser _writer.WriteStartElement(Dml.Chart.Prefix, Dml.Chart.ElSer, Dml.Chart.Ns); // EG_SerShared seriesFormatSequence.Convert(new SeriesMapping(this.WorkbookContext, this.ChartContext)); // c:cat seriesFormatSequence.Convert(new CatMapping(this.WorkbookContext, this.ChartContext, Dml.Chart.ElCat)); // c:val seriesFormatSequence.Convert(new ValMapping(this.WorkbookContext, this.ChartContext, Dml.Chart.ElVal)); _writer.WriteEndElement(); // c:ser } } // c:bandFmts // c:axId foreach (int axisId in crtSequence.ChartFormat.AxisIds) { writeValueElement(Dml.Chart.ElAxId, axisId.ToString()); } } _writer.WriteEndElement(); }
public void Render() { Device.EndScene(); Surf.Dispose(); Device.SetRenderTarget(0, OldRenderTarget); Device.DepthStencilSurface = OldDepthStencil; Device.BeginScene(); Device.VertexFormat = CustomVertex.PositionTextured.Format; Device.SetStreamSource(0, FullScreenQuad, 0); Effect.SetValue("render_target2D", RenderTarget2D); if (RenderTeleportEffect) { Effect.Technique = "Darken"; Effect.SetValue("time", Time); } else { Time = 0; if (RenderAlarmEffect) { Effect.Technique = "AlarmTechnique"; Effect.SetValue("alarmScaleFactor", IntVaivenAlarm.update(ElapsedTime)); } else { Effect.Technique = "DivingHelmet"; } } if (RenderPDA) { Effect.Technique = "PDA"; } Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1f, 0); Effect.Begin(FX.None); Effect.BeginPass(0); Device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2); Effect.EndPass(); Effect.End(); }
private static Point3d getSlopeIntercept(string surfaceTAR, Point3d pnt3dX, double slope, bool exists, Vector3d v3d) { Point3d pnt3d0 = Pub.pnt3dO; ObjectId idSurf = Surf.getSurface(surfaceTAR, out exists); TinSurface surf = idSurf.getEnt() as TinSurface; try { pnt3d0 = surf.GetIntersectionPoint(pnt3dX, v3d); } catch (System.Exception) { v3d = new Vector3d(v3d.X, v3d.Y, -slope); pnt3d0 = surf.GetIntersectionPoint(pnt3dX, v3d); } return(pnt3d0); }
updateSurfaceTarList() { try { cbxSurfaceDes.Items.Clear(); cbxSurfaceTar.Items.Clear(); List <string> Surfaces = Surf.getSurfaces(); foreach (string Name in Surfaces) { cbxSurfaceDes.Items.Add(Name); cbxSurfaceTar.Items.Add(Name); } } catch (SystemException) { } }
updateVolSurface(string strNameBASE, string strNameCOMP) { string nameSurface = string.Format("VOL_{0}_{1}", strNameBASE, strNameCOMP); List <string> nameSurfaces = Surf.getSurfaces(); for (int i = 0; i < nameSurfaces.Count; i++) { if (nameSurfaces[i] == nameSurface) { Surf.removeSurface(nameSurfaces[i]); } } TinSurface objSurfaceBASE = Surf.getTinSurface(strNameBASE); TinSurface objSurfaceCOMP = Surf.getTinSurface(strNameCOMP); TinVolumeSurface.Create(nameSurface, objSurfaceBASE.ObjectId, objSurfaceCOMP.ObjectId); }
private void btn_UpdateCurb_Click(object sender, EventArgs e) { using (BaseObjs._acadDoc.LockDocument()) { using (Transaction TR = BaseObjs.startTransactionDb()) { Surf.removeSurface("TEMP"); TypedValue[] TVs = new TypedValue[2]; TVs[0] = new TypedValue((int)DxfCode.Start, "POLYLINE"); TVs[1] = new TypedValue((int)DxfCode.LayerName, "CPNT-BRKLINE-TEMP"); Misc.deleteObjs(TVs); TR.Commit(); } } wlc.LocateCurb("CPNT", AlignPL, AlignRF); }
static void Main(string[] args) { Surf.GenerateDriver(1); IWebDriver driver = Surf.WebDriver; Surf.NavigateToURL(driver, "http://test.jeoit.com"); Click.InstantClick(driver, BySelector.ButtonBy(Enum.Buttons.InboxNew)); string result = Javascript.ExecuteJs(driver, "$('#selTemplate').val(356);$('#selTemplate').trigger('chosen:updated');$('#selTemplate').trigger('chosen:updated');$('#selTemplate').trigger('change');"); Write.WriteText(driver, BySelector.TextBy(Enum.Textbox.Konu), 3, "deneme konu"); Write.InstantWrite(driver, BySelector.TextBy(Enum.Textbox.anahtar_kelime), "deneme anahtar kelime"); Write.InstantWrite(driver, BySelector.TextBy(Enum.Textbox.belge_tarihi), "24.05.2014"); //Javascript.ExecuteJs(driver, "$('#txtDistributionAgency2').autocomplete({source: yerler, select: function (event, ui) { $('#txtDistributionAgency2').val(ui.item.value); return false;} });"); //belge içeriği girişi Javascript.ExecuteJs(driver, "CKEDITOR.instances.jquery_ckeditor.insertText('deneme içerik')"); Click.InstantClick(driver, BySelector.ButtonBy(Enum.Buttons.imza_ekle)); AutoComplete.Choose(driver, "bili", "txtDistributionAgency2", "ui-id-125"); //Console.WriteLine(result); //Write.InstantWrite(driver, BySelector.TextBy(Enum.Textbox.nereye), "bili"); //Click.InstantClick(driver, BySelector.ButtonBy(Enum.Buttons.nereye_secimi)); Console.WriteLine(); Console.WriteLine("End Of Process"); Console.ReadKey(); }
public static void makeSurfaceBOT() { string strSurfaceName = "BOT"; EW_CheckSurfaceStyles.checkSurfaceStyles(strSurfaceName); Surf.removeSurface("BOT"); TinSurface objSurfaceBOT = Surf.addTinSurface("BOT", out exists); ObjectId idCivilPntGrp = CgPnt_Group.checkPntGroup("BOT"); objSurfaceBOT.PointGroupsDefinition.AddPointGroup(idCivilPntGrp); SelectionSet objSSet = EW_Utility1.buildSSet13(); ObjectId[] idsBrksArray = objSSet.GetObjectIds(); ObjectIdCollection idsBrks = new ObjectIdCollection(); foreach (ObjectId id in idsBrksArray) { idsBrks.Add(id); } objSurfaceBOT.BreaklinesDefinition.AddStandardBreaklines(idsBrks, 1.0, 0, 0, 0); ObjectId idLWPline = EW_Utility1.buildSSetGradingLim().GetObjectIds()[0]; if (idLWPline != ObjectId.Null) { ObjectIdCollection ids = new ObjectIdCollection(); ids.Add(idLWPline); objSurfaceBOT.BoundariesDefinition.AddBoundaries(ids, 1, Autodesk.Civil.SurfaceBoundaryType.Outer, true); objSurfaceBOT.Rebuild(); } else { MessageBox.Show("GRADING LIMIT not found - OUTER BOUNDARY not added."); } }
makeRemSurface(double dblDepth) { EW_CheckSurfaceStyles.checkSurfaceStyles("EXIST"); Point3d pnt3dMove0 = Point3d.Origin; Point3d pnt3dMoveX = new Point3d(0, 0, dblDepth * -1); Matrix3d mtx3d = Matrix3d.Displacement(pnt3dMoveX - pnt3dMove0); TinSurface objSurfaceExist = Surf.getTinSurface("EXIST"); ObjectId idSurface = objSurfaceExist.copy(); using (var tr = BaseObjs.startTransactionDb()) { TinSurface surface = (TinSurface)tr.GetObject(idSurface, OpenMode.ForWrite); surface.Name = "EG-ADJ2"; Layer.manageLayers("EG-ADJ2-SURFACE"); surface.Layer = "EG-ADJ2" + "-SURFACE"; surface.TransformBy(mtx3d); surface.Rebuild(); } }
getAverageElev(ObjectId idPoly, bool boolShowPoints, string strSurface) { double dblZ_Total = 0; double dblZ_AVG = 0; bool exists = false; ObjectId idSurfaceEXIST = Surf.getSurface(strSurface, out exists); TinSurface surfaceEXIST = (TinSurface)idSurfaceEXIST.getEnt(); if (surfaceEXIST.GetGeneralProperties().MinimumElevation <= 0.0) { Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowAlertDialog(string.Format("Check Surface EXIST elevations: Minimum elevation: {0}", surfaceEXIST.GetGeneralProperties().MinimumElevation)); return(0); } using (BaseObjs._acadDoc.LockDocument()) { if (!idPoly.isRightHand()) { idPoly.reversePolyX(); } idPoly.checkIfClosed(); } Point3dCollection pntsGrid = Misc.getBldgLimitsAVG(idPoly, 20); Point3dCollection pntsGridElev = new Point3dCollection(); foreach (Point3d pnt3d in pntsGrid) { try { double dblZ = surfaceEXIST.FindElevationAtXY(pnt3d.X, pnt3d.Y); dblZ_Total = dblZ_Total + dblZ; if (boolShowPoints) { pntsGridElev.Add(new Point3d(pnt3d.X, pnt3d.Y, dblZ)); } } catch (System.Exception ex) { BaseObjs.writeDebug(ex.Message + " Grading_Floor.cs: line: 115"); } } if (boolShowPoints) { uint pntNum; using (BaseObjs._acadDoc.LockDocument()) { foreach (Point3d pnt3d in pntsGridElev) { pnt3d.setPoint(out pntNum, "CPNT-ON"); } } } dblZ_AVG = dblZ_Total / (pntsGrid.Count); return(dblZ_AVG); }
LocateCurb4(string strName, Alignment objAlignPL, Alignment objAlignRF) { bool success = false; Profile objProfilePL = default(Profile); Profile objProfileRF = default(Profile); double B1 = double.Parse(fWall4.tbx_B1.Text); double B2 = double.Parse(fWall4.tbx_B2.Text); double S0 = double.Parse(fWall4.tbx_S0.Text); double S1 = double.Parse(fWall4.tbx_S1.Text); double S2 = double.Parse(fWall4.tbx_S2.Text); double SG = double.Parse(fWall4.tbx_SG.Text); double CF = double.Parse(fWall4.tbx_CF.Text); double CV = 0; double CH = 0; List <Point3d> pnts3dRF = new List <Point3d>(); List <Point3d> pnts3dFL = new List <Point3d>(); List <Point3d> pnts3dTC = new List <Point3d>(); List <Point3d> pnts3dTOE = new List <Point3d>(); List <Point3d> pnts3dTOP = new List <Point3d>(); List <Point3d> pnts3dPL = new List <Point3d>(); double dblOffsetPL = 0.0, dblOffsetRF = 0.0, dblEasting = 0.0, dblNorthing = 0.0; double dblElevRF = 0, dblElevRFs = 0, dblElevFL = 0, dblElevBC = 0, dblElevTOE = 0, dblElevTOP = 0, dblElevPL = 0, dblElevDiff = 0; double dblStationRF = 0, dblStationPL = 0; double XT = 0, X0 = 0, X1 = 0, X2 = 0, dblDX = 0, dblDY = 0; bool boolMakeTempSurface = false; try { int intSign = fWall4.Side; List <double> dblStationsFinal = new List <double>(); dblStationsFinal = fWall4.Stations; if ((dblStationsFinal.Count == 0)) { return(false); } else { objProfileRF = Prof.getProfile(objAlignRF.ObjectId, strName); objProfilePL = Prof.getProfile(objAlignPL.ObjectId, "EXIST"); } Point3d pnt3dBeg = default(Point3d); Point3d pnt3dEnd = default(Point3d); bool boolStart = false; bool boolDone = false; for (int i = 0; i < dblStationsFinal.Count; i++) { dblStationRF = dblStationsFinal[i]; //CURRENT STATION ON REF Debug.Print(dblStationRF.ToString()); dblEasting = 0; dblNorthing = 0; if (System.Math.Abs(dblStationRF - objAlignRF.StartingStation) < 0.1) { dblStationRF = Base_Tools45.Math.roundUP2(objAlignRF.StartingStation); } if (System.Math.Abs(dblStationRF - objAlignRF.EndingStation) < 0.1) { dblStationRF = Base_Tools45.Math.roundDown2(objAlignRF.EndingStation); } try { objAlignRF.PointLocation(dblStationRF, 0.0, ref dblEasting, ref dblNorthing); } catch (Autodesk.Civil.PointNotOnEntityException) { } try { objAlignPL.StationOffset(dblEasting, dblNorthing, ref dblStationPL, ref dblOffsetPL); // CORRESPONDING STATION ON PL } catch (Autodesk.Civil.PointNotOnEntityException) { dblStationPL = 0.0; } //CHECK IF if (System.Math.Round(dblStationRF, 1) >= System.Math.Round(objAlignRF.StartingStation, 1)) { boolStart = true; } if (System.Math.Round(dblStationRF, 1) <= System.Math.Round(objAlignRF.EndingStation, 1)) { boolDone = false; } if (boolStart == true & boolDone == false) { try { dblElevRF = objProfileRF.ElevationAt(dblStationRF); //elevation on REF at current REF station } catch (Autodesk.AutoCAD.Runtime.Exception) { } try { dblElevPL = objProfilePL.ElevationAt(Base_Tools45.Math.roundDown2(dblStationPL)); //elevation on PL at PL station corresponding to REF station } catch (Autodesk.AutoCAD.Runtime.Exception) { dblElevPL = 0; } //valid surface elevations for both RF and PL if (dblElevRF > 0 & dblElevPL > 0) { dblElevTOP = dblElevPL - (B2 * S2); //top of slope - always sloping away from PL try { objAlignRF.PointLocation(dblStationRF, 0.0, ref dblEasting, ref dblNorthing); //point location at RF align station corresponding to PL station } catch (Autodesk.AutoCAD.Runtime.Exception) { } Point3d pnt3d = new Point3d(dblEasting, dblNorthing, dblElevRF); pnts3dRF.Add(pnt3d); dblElevDiff = dblElevRF - dblElevPL; try { objAlignPL.StationOffset(dblEasting, dblNorthing, ref dblStationPL, ref dblOffsetPL); //station and offset from PL to REF } catch (Autodesk.Civil.PointNotOnEntityException) { dblStationPL = 0.0; } //0 station means that the return station was outside limits if (dblStationPL == 0) { pnt3dBeg = new Point3d(dblEasting, dblNorthing, 0.0); //point location at REF align dblStationPL = objAlignPL.EndingStation; objAlignPL.PointLocation(objAlignPL.EndingStation, 0, ref dblEasting, ref dblNorthing); pnt3dEnd = new Point3d(dblEasting, dblNorthing, 0.0); //point location at end PL align dblOffsetPL = pnt3dBeg.getDistance(pnt3dEnd); //distance from REF to PL } XT = System.Math.Abs(dblOffsetPL); if (CF != 0) { CV = CF / 12 + 0.021; CH = CF / 12 / 4 + 0.5; } else { CV = 0; CH = 0; } double SLOPE = 0.0; //PL lower than REF - slope down if (dblElevDiff >= 0) { SLOPE = SG * -1; } else { SLOPE = SG; } X1 = ((dblElevRF - dblElevPL) + CV + (XT - CH - B2) * SLOPE + (B2 * S2)) / (SLOPE - S1); if (X1 < 0) { boolMakeTempSurface = true; dblElevRFs = dblElevPL - (B2 * S2) - (XT - B2) * SLOPE; dblDY = dblElevRFs - dblElevRF; if (CV == 0) { if (SLOPE > 0) { if (S1 > 0) { X2 = XT - B2 + dblDY / (SLOPE - S1); } else { } } else { } //dblElevPL = dblElevPL; objAlignPL.PointLocation(dblStationPL, 0.0, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevPL); pnts3dPL.Add(pnt3d); dblElevTOP = dblElevPL - (B2 * S2); objAlignPL.PointLocation(dblStationPL, B2 * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOP); pnts3dTOP.Add(pnt3d); dblElevTOE = dblElevPL - (B2 * S2) - (X2 * SLOPE); objAlignPL.PointLocation(dblStationPL, (B2 + X2) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOE); pnts3dTOE.Add(pnt3d); dblElevBC = dblElevTOE; objAlignPL.PointLocation(dblStationPL, (B2 + X2) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevBC); pnts3dTC.Add(pnt3d); dblElevFL = dblElevRF + X1 * S0; objAlignPL.PointLocation(dblStationPL, (XT - X1) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevFL); pnts3dFL.Add(pnt3d); } else if (CV > 0) { dblDX = (dblDY - (B1 * S1) - CV - (CH + B1) * S0) / (SLOPE - S0); //dblElevPL = dblElevPL; objAlignPL.PointLocation(dblStationPL, 0.0, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevPL); pnts3dPL.Add(pnt3d); dblElevTOP = dblElevPL - (B2 * S2); objAlignPL.PointLocation(dblStationPL, B2 * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOP); pnts3dTOP.Add(pnt3d); dblElevTOE = dblElevTOP - ((X2 + dblDX) * SLOPE); objAlignPL.PointLocation(dblStationPL, (B2 + X2 + dblDX) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOE); pnts3dTOE.Add(pnt3d); dblElevBC = dblElevTOE - (B1 * S1); objAlignPL.PointLocation(dblStationPL, (B2 + X2 + dblDX + B1) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevBC); pnts3dTC.Add(pnt3d); dblElevFL = dblElevBC - CV; objAlignPL.PointLocation(dblStationPL, (B2 + X2 + dblDX + B1 + CH) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevFL); pnts3dFL.Add(pnt3d); } } else if (X1 >= 0) { if (X1 > B1) { if (S0 == S1) { X2 = XT - CH - X1 - B2; //all good we use B1 } else if (S0 > S1) { dblDX = ((dblElevRF - dblElevPL) + CV + (B1 * S1) + (B2 * S2) + (XT - CH - B1 - B2) * SLOPE) / (SLOPE - S0); X2 = XT - dblDX - CH - B1 - B2; } else if (S0 < S1) { dblDX = ((dblElevRF - dblElevPL) + CV + (B1 * S1) + (B2 * S2) + (XT - CH - B1 - B2) * SLOPE) / (SLOPE - S0); X2 = XT - dblDX - CH - B1 - B2; } } else if (X1 < B1) { if (S0 > S1) { dblDX = ((dblElevRF - dblElevPL) + CV + (B1 * S1) + (XT - CH - B1 - B2) * SLOPE + (B2 * S2)) / (S0 - SLOPE); X2 = XT - CH - B1 - B2 + dblDX; } else if (S0 == S1) { X2 = XT - CH - X1 - B2; //B1 is used no change necessary } else if (S0 < S1) { dblDX = ((dblElevRF - dblElevPL) + CV + (B1 * S1) + (XT - CH - B1 - B2) * SLOPE + (B2 * S2)) / (S0 - SLOPE); X2 = XT - CH - B1 - B2 + dblDX; } } //dblElevPL = dblElevPL; objAlignPL.PointLocation(dblStationPL, 0.0, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevPL); pnts3dPL.Add(pnt3d); dblElevTOP = dblElevPL - (B2 * S2); objAlignPL.PointLocation(dblStationPL, B2 * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOP); pnts3dTOP.Add(pnt3d); dblElevTOE = dblElevTOP - (X2 * SLOPE); objAlignPL.PointLocation(dblStationPL, (B2 + X2) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOE); pnts3dTOE.Add(pnt3d); dblElevBC = dblElevTOE - (B1 * S1); objAlignPL.PointLocation(dblStationPL, (B2 + X2 + B1) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevBC); pnts3dTC.Add(pnt3d); dblElevFL = dblElevBC - CV; objAlignPL.PointLocation(dblStationPL, (B2 + X2 + B1 + CH) * intSign, ref dblEasting, ref dblNorthing); //point perp to PL pnt3d = new Point3d(dblEasting, dblNorthing, dblElevFL); pnts3dFL.Add(pnt3d); } } } } ObjectId idPoly3d = ObjectId.Null; using (BaseObjs._acadDoc.LockDocument()) { using (Transaction TR = BaseObjs.startTransactionDb()) { try { ObjectIdCollection objEntIDs = new ObjectIdCollection(); //Dim intXDataType As List(Of int) = New List(Of int)(2) //Dim varXDataVal As List(Of Object) = New List(Of Object)(2) string strLayer = null; if (boolMakeTempSurface) { strLayer = "CPNT-BRKLINE-TEMP"; } else { strLayer = "CPNT-BRKLINE"; } Layer.manageLayers(strLayer); //intXDataType.Add(1001) : varXDataVal.Add("PL") TypedValue[] tvs = new TypedValue[2]; tvs[0] = new TypedValue(1001, "PL"); if (boolMakeTempSurface == false) { idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dRF, strLayer, 6); tvs[1] = new TypedValue(1000, "REF"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dFL, strLayer, 1); tvs[1] = new TypedValue(1000, "FL"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); } else { idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dFL, strLayer, 1); tvs[1] = new TypedValue(1000, "FL"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); } idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dTC, strLayer, 2); tvs[1] = new TypedValue(1000, "TC"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dTOE, strLayer, 3); tvs[1] = new TypedValue(1000, "TOE"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dTOP, strLayer, 4); tvs[1] = new TypedValue(1000, "TOP"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnts3dPL, strLayer, 5); tvs[1] = new TypedValue(1000, "PL"); idPoly3d.setXData(tvs, "PL"); objEntIDs.Add(idPoly3d); ObjectIdCollection objEntEndIDs = wdp.makeEndBrklinesORG(strLayer, objEntIDs, false); bool exists = false; if (boolMakeTempSurface == false) { TinSurface objSurfaceCPNT = Surf.getTinSurface("CPNT-ON", out exists); objSurfaceCPNT.BreaklinesDefinition.AddStandardBreaklines(objEntIDs, 1, 0, 0, 0); objSurfaceCPNT.BreaklinesDefinition.AddStandardBreaklines(objEntEndIDs, 1, 0, 0, 0); } else { TinSurface objSurfaceTemp = Surf.getTinSurface("TEMP", out exists); objSurfaceTemp.BreaklinesDefinition.AddStandardBreaklines(objEntIDs, 1, 0, 0, 0); objSurfaceTemp.BreaklinesDefinition.AddStandardBreaklines(objEntEndIDs, 1, 0, 0, 0); } } catch (Autodesk.AutoCAD.Runtime.Exception ex) { Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowAlertDialog(ex.ToString()); } TR.Commit(); } } } catch (Autodesk.AutoCAD.Runtime.Exception) { MessageBox.Show("LocateCurb"); return(false); } return(success); }
CreateProfileByDesign(string strName, Alignment objAlign) { List <PNT_DATA> varPNT_DATA = new List <PNT_DATA>(); Profile objProfile = default(Profile); string strLayerName = null; short i = 0; Profile objProfileExist = Prof.getProfile(objAlign.ObjectId, "EXIST"); strLayerName = "PROFILE-" + strName; ObjectId idLayer = Layer.manageLayers(strLayerName); varPNT_DATA = fWall1.PNTSDESIGN; Prof.removeProfile(objAlign.ObjectId, strName); //Dim idProfileStyle As ObjectId = Prof_Style.getProfileStyle("WALL") //Dim idStyleLabelSet As ObjectId = Prof_Style.getProfileLabelSetStyle("WALL") ObjectId idProfileStyle = Prof_Style.getProfileStyle("Standard"); ObjectId idStyleLabelSet = Prof_Style.getProfileLabelSetStyle("Standard"); using (BaseObjs._acadDoc.LockDocument()) { using (Transaction TR = BaseObjs.startTransactionDb()) { objProfile = Prof.addProfileByLayout(strName, objAlign.ObjectId, idLayer, idProfileStyle, idStyleLabelSet); TR.Commit(); } } double dblBenchWidth1 = Convert.ToDouble(fWall1.tbx_B1.Text); double dblBenchWidth2 = Convert.ToDouble(fWall1.tbx_B2.Text); double dblCurbHeight = Convert.ToDouble(fWall1.tbx_CF.Text); double dblEasting = 0.0; double dblNorthing = 0.0; List <Point3d> pnt3dFL = new List <Point3d>(); List <Point3d> pnt3dTC = new List <Point3d>(); List <Point3d> pnt3dTOE = new List <Point3d>(); List <Point3d> pnt3dTS = new List <Point3d>(); List <Point3d> pnt3dTOP = new List <Point3d>(); short intSign = 0; double dblElevFL = 0; double dblElevTC = 0; double dblElevTOE = 0; double dblElevTS = 0; double dblElevTOP = 0; double dblElevEXIST = 0; double dblElevDiff = 0; double dblOffset = 0; ObjectId idPoly3d = ObjectId.Null; double dblSlope = Convert.ToDouble(fWall1.tbx_SG.Text); Point3d pnt3d = default(Point3d); double X = 0; double X2 = 0; double X1 = 0; for (i = 0; i <= varPNT_DATA.Count - 1; i++) { dblElevFL = varPNT_DATA[i].z; dblElevEXIST = objProfileExist.ElevationAt(varPNT_DATA[i].STA); dblElevDiff = dblElevFL - dblElevEXIST; dblOffset = varPNT_DATA[i].OFFSET; if (dblOffset < 0) { intSign = -1; dblOffset = dblOffset * -1; } else { intSign = 1; } if (dblElevFL > 0 & dblElevEXIST > 0) { dblElevTS = dblElevEXIST - dblBenchWidth2 * 0.02; dblElevTC = dblElevFL + dblCurbHeight / 12; objAlign.PointLocation(varPNT_DATA[i].STA, dblOffset * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevFL); pnt3dFL.Add(pnt3d); objAlign.PointLocation(varPNT_DATA[i].STA, (dblOffset - 0.1) * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTC); pnt3dTC.Add(pnt3d); dblElevDiff = dblElevFL - dblElevEXIST; if (dblElevDiff < 0) { X = dblOffset - dblBenchWidth2; X2 = (dblElevTS - dblElevTC - (0.02 * dblOffset)) / dblSlope; X1 = X - X2; if (X1 > dblBenchWidth1) { dblElevTOE = dblElevTC + X1 * 0.02; objAlign.PointLocation(varPNT_DATA[i].STA, (dblOffset - X1) * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOE); pnt3dTOE.Add(pnt3d); dblElevTS = dblElevTOE + dblSlope * X2; objAlign.PointLocation(varPNT_DATA[i].STA, (dblOffset - (X1 + X2)) * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTS); pnt3dTS.Add(pnt3d); dblElevTOP = dblElevTS + 0.02 * dblBenchWidth2; objAlign.PointLocation(varPNT_DATA[i].STA, (dblOffset - (X1 + X2 + dblBenchWidth2)) * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOP); pnt3dTOP.Add(pnt3d); objProfile.PVIs.AddPVI(varPNT_DATA[i].STA, dblElevTOP); } else { dblElevTOE = dblElevTC + dblBenchWidth1 * 0.02; objAlign.PointLocation(varPNT_DATA[i].STA, (dblOffset - dblBenchWidth1) * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOE); pnt3dTOE.Add(pnt3d); dblElevTS = dblElevTOE + dblSlope * dblOffset - (dblBenchWidth1 + dblBenchWidth2); objAlign.PointLocation(varPNT_DATA[i].STA, (dblOffset - (X1 + X2)) * intSign, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTS); pnt3dTS.Add(pnt3d); dblElevTOP = dblElevTS + 0.02 * dblBenchWidth2; objAlign.PointLocation(varPNT_DATA[i].STA, 0.0, ref dblEasting, ref dblNorthing); pnt3d = new Point3d(dblEasting, dblNorthing, dblElevTOP); pnt3dTOP.Add(pnt3d); objProfile.PVIs.AddPVI(varPNT_DATA[i].STA, dblElevTOP); } } else if (dblElevDiff > 0) { dblElevTOP = dblElevTC + 0.02 * dblOffset; objAlign.PointLocation(varPNT_DATA[i].STA, 0.0, ref dblEasting, ref dblNorthing); pnt3dTOP.Add(new Point3d(dblEasting, dblNorthing, dblElevTOP)); objProfile.PVIs.AddPVI(varPNT_DATA[i].STA, dblElevTOP); } } } try { ObjectIdCollection objEntIds = new ObjectIdCollection(); idPoly3d = Base_Tools45.Draw.addPoly3d(pnt3dFL); objEntIds.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnt3dTC); objEntIds.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnt3dTOE); objEntIds.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnt3dTS); objEntIds.Add(idPoly3d); idPoly3d = Base_Tools45.Draw.addPoly3d(pnt3dTOP); objEntIds.Add(idPoly3d); bool exists = false; TinSurface objSurfaceCPNT = Surf.getTinSurface("CPNT-ON", out exists); objSurfaceCPNT.BreaklinesDefinition.AddStandardBreaklines(objEntIds, 0, 0, 0, 0); } catch (Autodesk.AutoCAD.Runtime.Exception) { } objProfile.Layer = strLayerName; }
CreateProfileBySurface(string strName, ObjectId idAlign, double dblAlignOffset) { string strAlignName = Align.getAlignName(idAlign); //Dim idProfileStyle As ObjectId = Prof_Style.getProfileStyle("WALL") //Dim idStyleLabelSet As ObjectId = Prof_Style.getProfileLabelSetStyle("WALL") ObjectId idProfileStyle = Prof_Style.getProfileStyle("Standard"); ObjectId idStyleLabelSet = Prof_Style.getProfileLabelSetStyle("Standard"); string strLayerName = string.Format("PROFILE-{0}", strAlignName); Alignment objAlignOff = null; if (dblAlignOffset != 0) { ObjectId idPoly = Align.getAlignmentPoly(idAlign); ObjectId idPolyOff = Base_Tools45.Draw.addPolyOffset(idPoly, dblAlignOffset); strAlignName = string.Format("{0}_{1}_OFF", strAlignName, dblAlignOffset); objAlignOff = Align.addAlignmentFromPoly(strAlignName, strLayerName, idPolyOff, "Thienes_Proposed", "Thienes_Proposed", true); } string strSurface = ""; if (strName == "CPNT") { strSurface = "CPNT-ON"; } else { strSurface = strName; } TinSurface objSurface = null; try { bool exists = false; objSurface = Surf.getTinSurface(strSurface, out exists); } catch (Autodesk.AutoCAD.Runtime.Exception) { System.Windows.Forms.MessageBox.Show(strSurface + " is not available."); } Profile objProfile = null; if (dblAlignOffset != 0) { Prof.removeProfile(objAlignOff.ObjectId, strName); } else { Prof.removeProfile(idAlign, strName); } ObjectId idStyle = default(ObjectId); ObjectId idLabel = default(ObjectId); using (BaseObjs._acadDoc.LockDocument()) { using (Transaction TR = BaseObjs.startTransactionDb()) { ObjectId idSurf = objSurface.ObjectId; ObjectId idLayer = Layer.manageLayers(strLayerName); string mess = string.Format("WALL,{0},{1},{2},{3},{4}", idAlign, idSurf, idLayer, idStyle, idLabel); BaseObjs.write(mess); try { objProfile = Prof.addProfileBySurface(strName, idAlign, idSurf, idLayer, idProfileStyle, idStyleLabelSet); objProfile.Layer = strLayerName; } catch (Autodesk.AutoCAD.Runtime.Exception exp) { Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowAlertDialog(exp.Message); } TR.Commit(); } } if (dblAlignOffset != 0) { ProfilePVI objPvi = null; List <PNT_DATA> varPnt_Data = new List <PNT_DATA>(); PNT_DATA vPnt_Data = new PNT_DATA(); for (int i = 0; i <= objProfile.PVIs.Count; i++) { objPvi = objProfile.PVIs[i]; vPnt_Data.STA = objPvi.Station; vPnt_Data.z = objPvi.Elevation; vPnt_Data.OFFSET = dblAlignOffset; varPnt_Data.Add(vPnt_Data); } fWall1.PNTSDESIGN = varPnt_Data; return(objAlignOff.ObjectId); } return(idAlign); }