/// <summary> /// Bloque: Corte de Sección - Efe Prima Ce /// </summary> /// <param name="P_XYZ">Coordenadas del Bloque</param> /// <param name="X1">Texto del corte, punta inicial.</param> /// <param name="X2">Texto del corte, punta final.</param> /// <param name="Distance1">Distancia medida desde el <paramref name="P_XYZ"/>, usualmente se asigna el espesor del elemento hacer el corte.</param> /// <param name="Position1X">Posición en X del Texto ubicado en la punta inicial, se recomienda en Columnas,Escala 1:75 0.1.</param> /// <param name="Position1Y">Posición en Y del Texto ubicado en la punta inicial, se recomienda en Columnas,Escala 1:75 -0.1688.</param> /// <param name="Position2X">Posición en X del Texto ubicado en la punta final, se recomienda en Columnas,Escala 1:75 <paramref name="Distance1"/> + 1.0 - <paramref name="Position1X"/></param> /// <param name="Position2Y">Posición en Y del Texto ubicado en la punta final, se recomienda en Columnas,Escala 1:75 -0.1688.</param> /// <param name="FlipSate1">Dirección del Bloque: True: Abajo, False: Arriba</param> /// <param name="Layer">Capa del Bloque.</param> /// <param name="Xscale">Escala en X del Bloque.</param> /// <param name="Yscale">Escala en Y del Bloque.</param> /// <param name="Zscale">Escala en Z del Bloque.</param> /// <param name="Rotation">Ángulo de rotación en grados del Bloque.</param> public static void B_Seccion(double[] P_XYZ, string X1, string X2, double Distance1, double Position1X, double Position2X, double Position1Y, double Position2Y, bool FlipSate1, string Layer, double Xscale, double Yscale, double Zscale, float Rotation) { if (AcadDoc != null) { AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Seccion", Xscale, Yscale, Zscale, Rotation); blockReference.Layer = Layer; var referenceProperty = blockReference.GetDynamicBlockProperties(); var attributeReference = blockReference.GetAttributes(); referenceProperty[0].Value = Position1X; referenceProperty[1].Value = Position1Y; referenceProperty[4].Value = Distance1; referenceProperty[2].Value = Position2X; referenceProperty[3].Value = Position2Y; if (FlipSate1 == true) { referenceProperty[6].Value = Convert.ToInt16(1); } attributeReference[0].TextString = X1; attributeReference[1].TextString = X2; blockReference.Update(); } }
/// <summary> /// Bloque: Nombre de Sección - Efe Prima Ce /// </summary> public static void B_NombreSeccion(double[] P_XYZ, string Seccion, string Escala, string Layer, double Xscale, double Yscale, double Zscale, float Rotation) { try { if (AcadDoc != null) { AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Titulo 1", Xscale, Yscale, Zscale, Rotation); blockReference.Layer = Layer; var attributeReference = blockReference.GetAttributes(); double Distance1 = (Seccion.Length - 3) * 0.05f; attributeReference[0].TextString = Seccion; attributeReference[1].TextString = Escala; var referenceProperty = blockReference.GetDynamicBlockProperties(); referenceProperty[0].Value = Distance1; blockReference.Update(); } } catch (Exception ex) { NotificadorErrores?.Invoke(ex.Message); } }
//BLOQUES ESPECIFICOS DE EFE PRIMA CE /// <summary> /// Bloque: Nivel de Sección - Efe Prima Ce /// </summary> /// <param name="P_XYZ">Coordenadas del Bloque.</param> /// <param name="Nivel">Texto correspondiente al nivel especificado, se recomienda asignar el texto así: N+/PLosa xx, “/P” es para agregar un espacio.</param> /// <param name="Distance1">Largo de la línea superior del bloque, en Escalas 1:75 se recomienda: 1.08 </param> /// <param name="Distance2">Largo de la línea inferior del bloque medido desde el <paramref name="P_XYZ"/>, en Escalas 1:75 se recomienda: 1.90</param> /// <param name="FlipSate1">Dirección del Bloque, False: Izquierda, True: Derecha</param> /// <param name="Layer">Capa del Bloque.</param> /// <param name="Xscale">Escala en X del Bloque.</param> /// <param name="Yscale">Escala en Y del Bloque.</param> /// <param name="Zscale">Escala en Z del Bloque.</param> /// <param name="Rotation">Ángulo de rotación en grados del Bloque.</param> public static void B_NivelSeccion(double[] P_XYZ, string Nivel, double Distance1, double Distance2, bool FlipSate1, string Layer, double Xscale, double Yscale, double Zscale, float Rotation) { try { if (AcadDoc != null) { AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Nivel seccion", Xscale, Yscale, Zscale, Rotation); blockReference.Layer = Layer; var referenceProperty = blockReference.GetDynamicBlockProperties(); var attributeReference = blockReference.GetAttributes(); referenceProperty[0].Value = Distance1; referenceProperty[2].Value = Distance2; if (FlipSate1 == true) { referenceProperty[4].Value = Convert.ToInt16(1); } attributeReference[0].TextString = Nivel; blockReference.Update(); } } catch (Exception ex) { NotificadorErrores?.Invoke(ex.Message); } }
/// <summary> /// Bloque: Nombre de Sección - Efe Prima Ce /// </summary> public static void B_NombreSeccion(double[] P_XYZ, string Seccion, string Escala, string Layer, double Xscale, double Yscale, double Zscale, float Rotation) { if (AcadDoc != null) { AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Titulo 1", Xscale, Yscale, Zscale, Rotation); blockReference.Layer = Layer; var referenceProperty = blockReference.GetDynamicBlockProperties(); var attributeReference = blockReference.GetAttributes(); attributeReference[0].TextString = Seccion; attributeReference[1].TextString = Escala; blockReference.Update(); } }
/// <summary> /// Bloque: Eje en Vigas y Nervios - efe Prima Ce /// </summary> /// <param name="P_XY">Coordenadas del Bloque [Sytem.Drawing]</param> /// <param name="Texto">Texto correspondiente al eje.</param> /// <param name="Layer">Capa del Bloque.</param> /// <param name="Xscale">Escala en X del Bloque.</param> /// <param name="Yscale">Escala en Y del Bloque.</param> /// <param name="Zscale">Escala en Z del Bloque.</param> /// <param name="Rotation">Ángulo de rotación en grados del Bloque.</param> public static void B_Ejes(PointF P_XY, string Texto, string Layer, double Xscale, double Yscale, double Zscale, double Rotation) { try { if (AcadDoc != null) { double[] P_XYZ = ConvertirPuntoEnDobules3D(P_XY); AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Eje", Xscale, Yscale, Zscale, Rotation); blockReference.Layer = Layer; var attributeReference = blockReference.GetAttributes(); attributeReference[0].TextString = Texto; blockReference.Update(); } } catch (Exception ex) { NotificadorErrores?.Invoke(ex.Message); } }
public void AcadApp_EndOpen(string filename) { IsOpenError = false; DelLayouts(); AcadApp.ActiveDocument.ActiveLayout = AcadApp.ActiveDocument.Layouts.Item("Model"); int tN = AcadApp.ActiveDocument.ModelSpace.Count; for (int i = 0; i < tN; i++) { if (AcadApp.ActiveDocument.ModelSpace.Item(i).EntityName == "AcDbBlockReference") { AcadBlockReference iBlockReference = (AcadBlockReference)AcadApp.ActiveDocument.ModelSpace.Item(i); if (iBlockReference.EffectiveName == GlobalInfo.FrameEffectiveName) { string iFVKey; FrameView iFrameView; iFVKey = String.Format("{0, 3}", iBlockReference.GetAttributes()[GlobalInfo.FramePageAttrID].TextString); iFrameView.Id = i; iFrameView.Page = iBlockReference.GetAttributes()[GlobalInfo.FramePageAttrID].TextString; iFrameView.LowerLeft = new double[] { iBlockReference.InsertionPoint[0] - iBlockReference.XScaleFactor * GlobalInfo.PlotPageWidth, iBlockReference.InsertionPoint[1], 0 }; iFrameView.UpperRight = new double[] { iBlockReference.InsertionPoint[0], iBlockReference.InsertionPoint[1] + iBlockReference.YScaleFactor * GlobalInfo.PlotPageHeight, 0 }; if (!FrameViewList.ContainsKey(iFVKey)) { FrameViewList.Add(iFVKey, iFrameView); } } } } FrameViewList = FrameViewList.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value); AcadApp.ActiveDocument.Layouts.Item("Model").ConfigName = GlobalInfo.ModelConfigName; AcadApp.ActiveDocument.Layouts.Item("Model").StyleSheet = StyleSheetName; foreach (KeyValuePair <string, FormatTask.FrameView> iFrameView in FrameViewList) { AddBlankLayout(iFrameView.Value.Page); AcadLayout iLayout = AcadApp.ActiveDocument.Layouts.Item(iFrameView.Value.Page); AcadApp.ActiveDocument.ActiveLayout = iLayout; iLayout.ConfigName = GlobalInfo.PlotConfigName; iLayout.CanonicalMediaName = GlobalInfo.PlotCanonicalMediaName; iLayout.PlotRotation = AcPlotRotation.ac0degrees; iLayout.PaperUnits = AcPlotPaperUnits.acMillimeters; iLayout.SetWindowToPlot(new double[] { 0, 0 }, new double[] { GlobalInfo.PlotPageWidth, GlobalInfo.PlotPageHeight }); iLayout.PlotType = AcPlotType.acWindow; iLayout.UseStandardScale = true; iLayout.StandardScale = AcPlotScale.ac1_1; iLayout.CenterPlot = true; iLayout.StyleSheet = StyleSheetName; AcadPViewport iPViewport = AcadApp.ActiveDocument.PaperSpace.AddPViewport(new double[] { GlobalInfo.PlotPageWidth / 2, GlobalInfo.PlotPageHeight / 2, 0 }, GlobalInfo.PlotPageWidth, GlobalInfo.PlotPageHeight); iPViewport.Display(true); iPViewport.Layer = "0"; iPViewport.ViewportOn = true; AcadApp.ActiveDocument.MSpace = true; AcadApp.ActiveDocument.ActivePViewport = iPViewport; AcadApp.ZoomWindow(iFrameView.Value.LowerLeft, iFrameView.Value.UpperRight); AcadApp.ActiveDocument.MSpace = false; iPViewport.DisplayLocked = true; } AcadApp.ActiveDocument.ActiveLayout = AcadApp.ActiveDocument.Layouts.Item("Model"); foreach (KeyValuePair <string, FormatTask.FrameView> iFrameView in FrameViewList) { AcadLayout iLayout = AcadApp.ActiveDocument.Layouts.Item(iFrameView.Value.Page); AcadApp.ActiveDocument.ActiveLayout = iLayout; AcadApp.ZoomAll(); } DelLayout(GlobalInfo.TempLayoutName); AcadApp.ActiveDocument.ActiveLayout = AcadApp.ActiveDocument.Layouts.Item("Model"); AcadApp.ZoomAll(); IsSaveError = !SaveDocument(); AcadApp.ActiveDocument.SendCommand("CLOSE\n"); }