Ejemplo n.º 1
0
 internal void FriendQuit()
 {
     if (mblnOpened)
     {
         mobjDictReadCodes  = null;
         mobjDictReadValues = null;
         mobjAcadLineTypes  = null;
         mobjAcadDatabase   = null;
         mblnOpened         = false;
     }
 }
Ejemplo n.º 2
0
        private bool InternReadTable(ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            int dlngIdx = checked (mlngTblBeg + 1);
            Dictionary <object, object> dobjDictXDictionary2 = new Dictionary <object, object>();
            double ddblObjectID    = default(double);
            double ddblOwnerID     = default(double);
            int    dlngCount       = default(int);
            bool   InternReadTable = default(bool);

            if (hwpDxf_ReadRef.BkDXFReadRef_AcadSymbolTable(mobjAcadDatabase, mobjDictReadCodes, mobjDictReadValues, ref dlngIdx, ref ddblObjectID, ref ddblOwnerID, ref dlngCount, ref dobjDictXDictionary2, ref nrstrErrMsg))
            {
                object dvarXDataType  = default(object);
                object dvarXDataValue = default(object);
                bool   dblnError      = !hwpDxf_ReadBas.BkDXFReadBas_XData(ref dlngIdx, mobjDictReadCodes, mobjDictReadValues, ref dvarXDataType, ref dvarXDataValue, ref nrstrErrMsg);
                if (!dblnError)
                {
                    mobjAcadLineTypes = mobjAcadDatabase.FriendAddAcadObjectLineTypes(ref nrstrErrMsg, ddblObjectID);
                    if (mobjAcadLineTypes == null)
                    {
                        nrstrErrMsg = "Das Objekt konnte nicht hinzugefügt werden.";
                        dblnError   = true;
                    }
                    else
                    {
                        mobjAcadLineTypes.FriendSetDictXDictionary = dobjDictXDictionary2;
                        mobjAcadLineTypes.SetXData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue));
                        bool dblnStop = default(bool);
                        while (dlngIdx <= mlngTblEnd && !dblnError && !dblnStop)
                        {
                            int    dlngCode  = Conversions.ToInteger(mobjDictReadCodes[dlngIdx]);
                            object dvarValue = RuntimeHelpers.GetObjectValue(mobjDictReadValues[dlngIdx]);
                            if (dlngCode != 0 && dlngCode != 0)
                            {
                                nrstrErrMsg = "Ungültiger Gruppencode für Tabelleneintrag/ende in Zeile " + Conversions.ToString(checked (dlngIdx * 2 + 1)) + ".";
                                dblnError   = true;
                            }
                            else if (Operators.ConditionalCompareObjectEqual(dvarValue, "ENDTAB", TextCompare: false))
                            {
                                dlngIdx  = checked (dlngIdx + 1);
                                dblnStop = true;
                            }
                            else if (!InternReadLType(ddblObjectID, ref dlngIdx, ref mobjAcadLineTypes, ref nrstrErrMsg))
                            {
                                dblnError = true;
                            }
                        }
                    }
                }
                InternReadTable = !dblnError;
            }
            dobjDictXDictionary2 = null;
            return(InternReadTable);
        }
Ejemplo n.º 3
0
 public void ListTable(ref int rlngIdx)
 {
     mobjAcadLineTypes = mobjAcadDatabase.Linetypes;
     if (mobjAcadLineTypes != null)
     {
         InternAddToDictLine(ref rlngIdx, 0, "TABLE");
         mlngTblBeg = rlngIdx;
         AcadLineTypes acadLineTypes = mobjAcadLineTypes;
         InternAddToDictLine(ref rlngIdx, 2, acadLineTypes.DXFName);
         InternAddToDictLine(ref rlngIdx, 5, acadLineTypes.Handle);
         hwpDxf_List.BkDXFList_XDictionary((Dictionary <object, object>)acadLineTypes.DictXDictionaries, ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
         InternAddToDictLine(ref rlngIdx, 330, acadLineTypes.OwnerID);
         InternAddToDictLine(ref rlngIdx, 100, acadLineTypes.SuperiorObjectName);
         InternAddToDictLine(ref rlngIdx, 70, acadLineTypes.Count);
         object dvarXDataType  = default(object);
         object dvarXDataValue = default(object);
         acadLineTypes.GetXData(null, ref dvarXDataType, ref dvarXDataValue);
         hwpDxf_List.BkDXFList_XData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue), ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
         acadLineTypes = null;
         InternListTable(ref rlngIdx);
         mlngTblEnd = rlngIdx;
         InternAddToDictLine(ref rlngIdx, 0, "ENDTAB");
     }
 }
Ejemplo n.º 4
0
        private bool InternReadLType(double vdblDefOwnerID, ref int rlngIdx, ref AcadLineTypes robjAcadLineTypes, ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            Dictionary <object, object> dobjDictReactors2    = new Dictionary <object, object>();
            Dictionary <object, object> dobjDictXDictionary2 = new Dictionary <object, object>();
            int dlngStartIdx = rlngIdx;

            checked
            {
                double       ddblObjectID    = default(double);
                double       ddblOwnerID     = default(double);
                bool         InternReadLType = default(bool);
                AcadLineType dobjAcadLinetype2;
                if (hwpDxf_ReadRef.BkDXFReadRef_AcadSymbolTableRecord(mobjAcadDatabase, vdblDefOwnerID, "LTYPE", mobjDictReadCodes, mobjDictReadValues, ref rlngIdx, ref ddblObjectID, ref ddblOwnerID, ref dobjDictReactors2, ref dobjDictXDictionary2, ref nrstrErrMsg))
                {
                    bool dblnError = default(bool);
                    if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx], 100, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Objektname in Zeile " + Conversions.ToString(rlngIdx * 2 + 1) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadValues[rlngIdx], "AcDbLinetypeTableRecord", TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Objektname in Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 1], 2, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Linientypname in Zeile " + Conversions.ToString(rlngIdx * 2 + 3) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 2], 70, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Standard-Flag-Werte in Zeile " + Conversions.ToString(rlngIdx * 2 + 5) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 3], 3, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Beschreibung in Zeile " + Conversions.ToString(rlngIdx * 2 + 7) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 4], 72, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Ausrichtungscode in Zeile " + Conversions.ToString(rlngIdx * 2 + 9) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 5], 73, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Elementeanzahl in Zeile " + Conversions.ToString(rlngIdx * 2 + 11) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 6], 40, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Musterlänge in Zeile " + Conversions.ToString(rlngIdx * 2 + 13) + ".";
                        dblnError   = true;
                    }
                    else
                    {
                        string dstrName          = Conversions.ToString(mobjDictReadValues[rlngIdx + 1]);
                        int    dlngCode70        = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 2]);
                        string dstrDescription   = Conversions.ToString(mobjDictReadValues[rlngIdx + 3]);
                        int    dlngScaleToFit    = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 4]);
                        int    dlngNumDashes     = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 5]);
                        bool   flag              = false;
                        double ddblPatternLength = Conversions.ToDouble(mobjDictReadValues[rlngIdx + 6]);
                        rlngIdx += 7;
                        if (robjAcadLineTypes.FriendNameExist(dstrName))
                        {
                            nrstrErrMsg = "Linientyp " + dstrName + " ab Zeile " + Conversions.ToString(dlngStartIdx * 2 + 1) + " existiert bereits.";
                            dblnError   = true;
                        }
                        else
                        {
                            dobjAcadLinetype2 = robjAcadLineTypes.FriendAddAcadObject(dstrName, ddblObjectID, ref nrstrErrMsg);
                            if (dobjAcadLinetype2 == null)
                            {
                                nrstrErrMsg = "Das Objekt konnte nicht hinzugefügt werden.";
                                dblnError   = true;
                            }
                            else
                            {
                                AcadLineType acadLineType = dobjAcadLinetype2;
                                acadLineType.FriendLetFlags70     = dlngCode70;
                                acadLineType.Description          = dstrDescription;
                                acadLineType.FriendLetScaledToFit = (dlngScaleToFit == 83);
                                bool flag2 = false;
                                acadLineType.FriendLetPatternLength   = ddblPatternLength;
                                acadLineType.FriendSetDictReactors    = dobjDictReactors2;
                                acadLineType.FriendSetDictXDictionary = dobjDictXDictionary2;
                                acadLineType = null;
                                if (dlngNumDashes > 0)
                                {
                                    if (!InternReadDashes(ref rlngIdx, ref dobjAcadLinetype2, ref nrstrErrMsg))
                                    {
                                        dblnError = true;
                                    }
                                    else if (dlngNumDashes != dobjAcadLinetype2.Dashes.Count)
                                    {
                                        nrstrErrMsg = "Ungültige Anzahl der Linientypeinträgen vor Zeile " + Conversions.ToString(rlngIdx * 2 + 1) + ".";
                                        dblnError   = true;
                                    }
                                }
                                if (!dblnError)
                                {
                                    object dvarXDataType  = default(object);
                                    object dvarXDataValue = default(object);
                                    dblnError = !hwpDxf_ReadBas.BkDXFReadBas_XData(ref rlngIdx, mobjDictReadCodes, mobjDictReadValues, ref dvarXDataType, ref dvarXDataValue, ref nrstrErrMsg);
                                    if (!dblnError)
                                    {
                                        dobjAcadLinetype2.SetXData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue));
                                    }
                                }
                            }
                        }
                    }
                    InternReadLType = !dblnError;
                }
                dobjDictReactors2    = null;
                dobjDictXDictionary2 = null;
                dobjAcadLinetype2    = null;
                return(InternReadLType);
            }
        }