/// <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: Estibo para secciones circulares - Efe Prima Ce
 /// </summary>
 public static void B_Estribo_Circular(double[] P_XYZ, string Layer, double Radio, double Xscale, double Yscale, double Zscale, float Rotation)
 {
     if (AcadDoc != null)
     {
         AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Estribo circular", Xscale, Yscale, Zscale, Rotation);
     }
 }
        /// <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: Refuerzo i en seccion - Efe Prima Ce
        /// </summary>
        public static void Add_ref(double[] P_XYZ, string Layer, int Alzado, double Xscale, double Yscale, double Zscale, float Rotation)
        {
            AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Convenciones refuerzoV2", Xscale, Yscale, Zscale, Rotation);

            var referenceProperty = blockReference.GetDynamicBlockProperties();

            referenceProperty[0].Value = Alzado.ToString();

            blockReference.Layer = Layer;
            blockReference.Update();
        }
        /// <summary>
        /// Bloque: Conveciones de refuerzo - Efe Prima Ce
        /// </summary>
        /// <param name="P_XYZ">Coordenadas del Bloque</param>
        ///<param name="NombreRefuerzo">Numero de refuerzo.</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_CirculoRefuerzo(double[] P_XYZ, string NombreRefuerzo, string Layer, double Xscale, double Yscale, double Zscale, float Rotation)
        {
            if (AcadDoc != null)
            {
                AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Convenciones refuerzoV2", Xscale, Yscale, Zscale, Rotation);
                blockReference.Layer = Layer;

                var referenceProperty = blockReference.GetDynamicBlockProperties();

                referenceProperty[0].Value = NombreRefuerzo;
                blockReference.Update();
            }
        }
        /// <summary>
        /// Bloque: Ganchos Sección - Efe Prima Ce
        /// </summary>
        public static void B_Gancho(double[] P_XYZ, string Layer, double Longitud, double Xscale, double Yscale, double Zscale, float Rotation, short FlipState)
        {
            if (AcadDoc != null)
            {
                AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Gancho tipo 1", Xscale, Yscale, Zscale, 0);

                var referenceProperty = blockReference.GetDynamicBlockProperties();
                referenceProperty[2].Value = Longitud;
                referenceProperty[4].Value = FlipState;
                referenceProperty[5].Value = Math.PI * Rotation / 180;

                blockReference.Layer = Layer;
                blockReference.Update();
            }
        }
        /// <summary>
        /// Bloque de Estribo Tipo 6, normalmente se usa para Tabla de Estribos en Muros [efe Prima Ce]
        /// </summary>
        /// <param name="P_XY">Coordenadas del Bloque. [System.Drawing]</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>
        /// <param name="Distancia">Distancia recta del Estribo</param>
        /// <param name="EspesorReal">Espesor Real.</param>
        /// <param name="EspesorDoble">Espesor Doble.</param>
        public static void B_Estribo(PointF P_XY, string Layer, double Xscale, double Yscale, double Zscale, double Rotation, double Distancia, double EspesorReal, double EspesorDoble, double GanchoEstribo = 0.09)
        {
            if (AcadDoc != null)
            {
                AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(ConvertirPuntoEnDobules3D(P_XY), "FC_B_Estribo tipo 6", Xscale, Yscale, Zscale, Rotation);
                blockReference.Layer = Layer;

                var referenceProperty = blockReference.GetDynamicBlockProperties();

                referenceProperty[0].Value = Distancia;
                referenceProperty[2].Value = EspesorDoble;
                referenceProperty[4].Value = EspesorReal;
                referenceProperty[6].Value = GanchoEstribo;
            }
        }
        /// <summary>
        /// Bloque: Estibo de Sección - Efe Prima Ce
        /// </summary>
        public static void B_Estribo(double[] P_XYZ, string Layer, double Base, double Altura, double Xscale, double Yscale, double Zscale, float Rotation)
        {
            if (AcadDoc != null)
            {
                AcadBlockReference blockReference = AcadDoc.ModelSpace.InsertBlock(P_XYZ, "FC_B_Estribo tipo 1", Xscale, Yscale, Zscale, Rotation);

                var referenceProperty = blockReference.GetDynamicBlockProperties();

                referenceProperty[0].Value = Base;
                referenceProperty[2].Value = Altura;

                blockReference.Layer = Layer;
                blockReference.Update();
            }
        }
Esempio n. 10
0
        /// <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);
     }
 }
Esempio n. 12
0
        private bool InternReadBlockEntities(ref int rlngIdx, ref AcadBlock robjAcadBlock, ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            bool             dblnError            = default(bool);
            bool             dblnStop             = default(bool);
            AcadPolyfaceMesh dobjAcadPolyfaceMesh = default(AcadPolyfaceMesh);
            AcadPolygonMesh  dobjAcadPolygonMesh  = default(AcadPolygonMesh);
            Acad3DPolyline   dobjAcad3DPolyline   = default(Acad3DPolyline);
            AcadPolyline     dobjAcadPolyline     = default(AcadPolyline);

            while (rlngIdx <= mlngSecEnd && !dblnError && !dblnStop)
            {
                int    dlngCode2  = Conversions.ToInteger(mobjDictReadCodes[rlngIdx]);
                object dvarValue2 = RuntimeHelpers.GetObjectValue(mobjDictReadValues[rlngIdx]);
                if (dlngCode2 == 0 && Operators.ConditionalCompareObjectEqual(dvarValue2, "ENDBLK", TextCompare: false))
                {
                    dblnStop = true;
                }
                InternIncreaseIndex(ref rlngIdx, 1);
                if (dblnStop)
                {
                    continue;
                }
                object left = dvarValue2;
                if (Operators.ConditionalCompareObjectEqual(left, "ARC", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadArc(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "CIRCLE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadCircle(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "LINE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadLine(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "POINT", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadPoint(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "XLINE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadXline(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "RAY", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadRay(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "LWPOLYLINE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadLWPolyline(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "POLYLINE", TextCompare: false))
                {
                    int dlngAcadPolylineIdx = rlngIdx;
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadPolyline(ref dobjAcadPolyline, ref dobjAcad3DPolyline, ref dobjAcadPolygonMesh, ref dobjAcadPolyfaceMesh, mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                    if (dblnError)
                    {
                        continue;
                    }
                    bool dblnAcadPolyline = true;
                    while (rlngIdx <= mlngSecEnd && !dblnError && dblnAcadPolyline)
                    {
                        dlngCode2  = Conversions.ToInteger(mobjDictReadCodes[rlngIdx]);
                        dvarValue2 = RuntimeHelpers.GetObjectValue(mobjDictReadValues[rlngIdx]);
                        if (dlngCode2 != 0)
                        {
                            nrstrErrMsg = "Fehlender Objektnamencode in Zeile " + Conversions.ToString(checked (rlngIdx * 2 + 1)) + ".";
                            dblnError   = true;
                            continue;
                        }
                        InternIncreaseIndex(ref rlngIdx, 1);
                        object left2 = dvarValue2;
                        if (Operators.ConditionalCompareObjectEqual(left2, "VERTEX", TextCompare: false))
                        {
                            dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadVertex(mobjAcadDatabase, ref rlngIdx, ref dobjAcadPolyline, ref dobjAcad3DPolyline, ref dobjAcadPolygonMesh, ref dobjAcadPolyfaceMesh, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                            InternCheckIndex(rlngIdx);
                        }
                        else if (Operators.ConditionalCompareObjectEqual(left2, "SEQEND", TextCompare: false))
                        {
                            AcadDatabase       vobjAcadDatabase       = mobjAcadDatabase;
                            AcadBlockReference robjAcadBlockReference = null;
                            AcadMInsertBlock   robjAcadMInsertBlock   = null;
                            dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadSequenceEnd(vobjAcadDatabase, ref rlngIdx, ref robjAcadBlockReference, ref robjAcadMInsertBlock, ref dobjAcadPolyline, ref dobjAcad3DPolyline, ref dobjAcadPolygonMesh, ref dobjAcadPolyfaceMesh, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                            InternCheckIndex(rlngIdx);
                            dblnAcadPolyline = false;
                            dobjAcadPolyline?.FriendCalcSize();
                            dobjAcad3DPolyline?.FriendCalcSize();
                            dobjAcadPolyline     = null;
                            dobjAcad3DPolyline   = null;
                            dobjAcadPolygonMesh  = null;
                            dobjAcadPolyfaceMesh = null;
                        }
                        else
                        {
                            nrstrErrMsg = "Polylinie ohne Sequenzende ab Zeile " + Conversions.ToString(dlngAcadPolylineIdx) + ".";
                            dblnError   = true;
                        }
                    }
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "MTEXT", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadMText(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "TEXT", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadText(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "ATTDEF", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadAttributeDefinition(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "INSERT", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadBlockReference(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "SHAPE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadShape(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "ELLIPSE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadEllipse(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "HATCH", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadHatch(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "SPLINE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadSpline(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "TRACE", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadTrace(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else if (Operators.ConditionalCompareObjectEqual(left, "SOLID", TextCompare: false))
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadSolid(mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
                else
                {
                    dblnError = !hwpDxf_ReadEnt.BkDXFReadEnt_AcadUnknownEnt(mlngSecEnd, Conversions.ToString(dvarValue2), mobjAcadDatabase, ref rlngIdx, ref robjAcadBlock, mobjDictReadCodes, mobjDictReadValues, ref nrstrErrMsg);
                    InternCheckIndex(rlngIdx);
                }
            }
            bool InternReadBlockEntities = !dblnError;

            dobjAcadPolyfaceMesh = null;
            dobjAcadPolygonMesh  = null;
            dobjAcad3DPolyline   = null;
            dobjAcadPolyline     = null;
            return(InternReadBlockEntities);
        }
Esempio n. 13
0
        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");
        }