Пример #1
0
 internal void FriendQuit()
 {
     if (mblnOpened)
     {
         mobjDictReadCodes  = null;
         mobjDictReadValues = null;
         mobjAcadDimStyles  = null;
         mobjAcadDatabase   = null;
         mblnOpened         = false;
     }
 }
Пример #2
0
        public void ListTable(ref int rlngIdx)
        {
            mobjAcadDimStyles = mobjAcadDatabase.DimStyles;
            if (mobjAcadDimStyles == null)
            {
                return;
            }
            InternAddToDictLine(ref rlngIdx, 0, "TABLE");
            mlngTblBeg = rlngIdx;
            AcadDimStyles acadDimStyles = mobjAcadDimStyles;

            InternAddToDictLine(ref rlngIdx, 2, acadDimStyles.DXFName);
            InternAddToDictLine(ref rlngIdx, 5, acadDimStyles.Handle);
            hwpDxf_List.BkDXFList_XDictionary((Dictionary <object, object>)acadDimStyles.DictXDictionaries, ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
            InternAddToDictLine(ref rlngIdx, 330, acadDimStyles.OwnerID);
            InternAddToDictLine(ref rlngIdx, 100, acadDimStyles.SuperiorObjectName);
            InternAddToDictLine(ref rlngIdx, 70, acadDimStyles.Count);
            InternAddToDictLine(ref rlngIdx, 100, acadDimStyles.ObjectName);
            InternAddToDictLine(ref rlngIdx, 71, acadDimStyles.FriendGetUnknown71);
            Dictionary <object, object> dobjDictUnknown340 = acadDimStyles.FriendGetDictUnknown340;

            if (dobjDictUnknown340 != null)
            {
                object dvarItems = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(dobjDictUnknown340.Values));
                int    num       = Information.LBound((Array)dvarItems);
                int    num2      = Information.UBound((Array)dvarItems);
                for (int dlngIndex = num; dlngIndex <= num2; dlngIndex = checked (dlngIndex + 1))
                {
                    InternAddToDictLine(ref rlngIdx, 340, RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarItems, new object[1]
                    {
                        dlngIndex
                    }, null)));
                }
            }
            object dvarXDataType  = default(object);
            object dvarXDataValue = default(object);

            acadDimStyles.GetXData(null, ref dvarXDataType, ref dvarXDataValue);
            hwpDxf_List.BkDXFList_XData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue), ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
            acadDimStyles = null;
            InternListTable(ref rlngIdx);
            mlngTblEnd = rlngIdx;
            InternAddToDictLine(ref rlngIdx, 0, "ENDTAB");
        }
Пример #3
0
        private bool InternReadDimStyle(double vdblDefOwnerID, ref int rlngIdx, ref AcadDimStyles robjAcadDimStyles, 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         InternReadDimStyle = default(bool);
                AcadSysVar   dobjAcadSysVar2;
                AcadDimStyle dobjAcadDimStyle2;
                if (hwpDxf_ReadRef.BkDXFReadRef_AcadSymbolTableRecord(mobjAcadDatabase, vdblDefOwnerID, "DIMSTYLE", 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], "AcDbDimStyleTableRecord", 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 Dimstilname 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
                    {
                        string dstrName  = Conversions.ToString(mobjDictReadValues[rlngIdx + 1]);
                        int    dlngCode2 = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 2]);
                        rlngIdx += 3;
                        if (robjAcadDimStyles.FriendNameExist(dstrName))
                        {
                            nrstrErrMsg = "Bemaßungsstil " + dstrName + " ab Zeile " + Conversions.ToString(dlngStartIdx * 2 + 1) + " existiert bereits.";
                            dblnError   = true;
                        }
                        else
                        {
                            dobjAcadDimStyle2 = robjAcadDimStyles.FriendAddAcadObject(dstrName, ddblObjectID, ref nrstrErrMsg);
                            if (dobjAcadDimStyle2 == null)
                            {
                                nrstrErrMsg = "Das Objekt konnte nicht hinzugefügt werden.";
                                dblnError   = true;
                            }
                            else
                            {
                                AcadDimStyle acadDimStyle = dobjAcadDimStyle2;
                                acadDimStyle.FriendLetFlags70         = dlngCode2;
                                acadDimStyle.FriendSetDictReactors    = dobjDictReactors2;
                                acadDimStyle.FriendSetDictXDictionary = dobjDictXDictionary2;
                                object dvarXDataType  = default(object);
                                object dvarXDataValue = default(object);
                                acadDimStyle.SetXData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue));
                                acadDimStyle = null;
                                object dvarKeys            = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_KeyCollectionToArray(hwpDxf_Vars.pobjDictDxfDimVarOrder.Keys));
                                object dvarItems           = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(hwpDxf_Vars.pobjDictDxfDimVarOrder.Values));
                                int    dlngCode            = Conversions.ToInteger(mobjDictReadCodes[rlngIdx]);
                                int    num                 = Information.LBound((Array)dvarKeys);
                                int    num2                = Information.UBound((Array)dvarKeys);
                                string dstrTableRecordName = default(string);
                                for (int dlngKeyIdx = num; dlngKeyIdx <= num2; dlngKeyIdx++)
                                {
                                    int dlngKey = Conversions.ToInteger(NewLateBinding.LateIndexGet(dvarKeys, new object[1]
                                    {
                                        dlngKeyIdx
                                    }, null));
                                    string dstrItem = Conversions.ToString(NewLateBinding.LateIndexGet(dvarItems, new object[1]
                                    {
                                        dlngKeyIdx
                                    }, null));
                                    if (dlngCode != dlngKey)
                                    {
                                        continue;
                                    }
                                    object dvarValue;
                                    switch (dlngKey)
                                    {
                                    case 340:
                                        if (!InternFindTextStyleNameByObjectID(Conversions.ToDouble(mobjDictReadValues[rlngIdx]), ref dstrTableRecordName, ref nrstrErrMsg))
                                        {
                                            nrstrErrMsg = nrstrErrMsg + " In Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                                            dblnError   = true;
                                            break;
                                        }
                                        dvarValue = dstrTableRecordName;
                                        goto IL_0532;

                                    case 341:
                                        if (!InternFindBlockNameByObjectID(Conversions.ToDouble(mobjDictReadValues[rlngIdx]), ref dstrTableRecordName, ref nrstrErrMsg))
                                        {
                                            nrstrErrMsg = nrstrErrMsg + " In Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                                            dblnError   = true;
                                            break;
                                        }
                                        dvarValue = dstrTableRecordName;
                                        goto IL_0532;

                                    case 342:
                                        if (!InternFindBlockNameByObjectID(Conversions.ToDouble(mobjDictReadValues[rlngIdx]), ref dstrTableRecordName, ref nrstrErrMsg))
                                        {
                                            nrstrErrMsg = nrstrErrMsg + " In Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                                            dblnError   = true;
                                            break;
                                        }
                                        dvarValue = dstrTableRecordName;
                                        goto IL_0532;

                                    case 343:
                                        if (!InternFindBlockNameByObjectID(Conversions.ToDouble(mobjDictReadValues[rlngIdx]), ref dstrTableRecordName, ref nrstrErrMsg))
                                        {
                                            nrstrErrMsg = nrstrErrMsg + " In Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                                            dblnError   = true;
                                            break;
                                        }
                                        dvarValue = dstrTableRecordName;
                                        goto IL_0532;

                                    case 344:
                                        if (!InternFindBlockNameByObjectID(Conversions.ToDouble(mobjDictReadValues[rlngIdx]), ref dstrTableRecordName, ref nrstrErrMsg))
                                        {
                                            nrstrErrMsg = nrstrErrMsg + " In Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                                            dblnError   = true;
                                            break;
                                        }
                                        dvarValue = dstrTableRecordName;
                                        goto IL_0532;

                                    default:
                                    {
                                        dvarValue = RuntimeHelpers.GetObjectValue(mobjDictReadValues[rlngIdx]);
                                        goto IL_0532;
                                    }
IL_0532:
                                        dobjAcadSysVar2 = dobjAcadDimStyle2.FriendFindVariable(dstrItem);
                                        if (dobjAcadSysVar2 == null)
                                        {
                                            dobjAcadSysVar2 = (AcadSysVar)dobjAcadDimStyle2.FriendGetAcadSysVars.FriendAddXXX(dstrItem);
                                        }
                                        if (!dobjAcadSysVar2.FriendSetValue(RuntimeHelpers.GetObjectValue(dvarValue), vblnRaiseEvent: false, ref nrstrErrMsg))
                                        {
                                            nrstrErrMsg = nrstrErrMsg + " In Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                                            dblnError   = true;
                                            break;
                                        }
                                        rlngIdx++;
                                        dlngCode = Conversions.ToInteger(mobjDictReadCodes[rlngIdx]);
                                        continue;
                                    }
                                    break;
                                }
                                if (!dblnError)
                                {
                                    dblnError = !hwpDxf_ReadBas.BkDXFReadBas_XData(ref rlngIdx, mobjDictReadCodes, mobjDictReadValues, ref dvarXDataType, ref dvarXDataValue, ref nrstrErrMsg);
                                    if (!dblnError)
                                    {
                                        dobjAcadDimStyle2.SetXData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue));
                                    }
                                }
                            }
                        }
                    }
                    InternReadDimStyle = !dblnError;
                }
                dobjAcadSysVar2      = null;
                dobjDictReactors2    = null;
                dobjDictXDictionary2 = null;
                dobjAcadDimStyle2    = null;
                return(InternReadDimStyle);
            }
        }
Пример #4
0
        private bool InternReadTable(ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            int dlngIdx = checked (mlngTblBeg + 1);
            Dictionary <object, object> dobjDictXDictionary2 = new Dictionary <object, object>();
            Dictionary <object, object> dobjDictUnknown341   = 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))
            {
                mobjAcadDimStyles = mobjAcadDatabase.FriendAddAcadObjectDimStyles(ref nrstrErrMsg, ddblObjectID);
                bool dblnError;
                if (mobjAcadDimStyles == null)
                {
                    nrstrErrMsg = "Das Objekt konnte nicht hinzugefügt werden.";
                    dblnError   = true;
                }
                else
                {
                    mobjAcadDimStyles.FriendSetDictXDictionary = dobjDictXDictionary2;
                    int dlngUnknown71 = default(int);
                    if (InternReadDimStyleTable(ref dlngIdx, ref dlngUnknown71, ref dobjDictUnknown341, ref nrstrErrMsg))
                    {
                        mobjAcadDimStyles.FriendLetUnknown71      = dlngUnknown71;
                        mobjAcadDimStyles.FriendSetDictUnknown340 = dobjDictUnknown341;
                        object dvarXDataType  = default(object);
                        object dvarXDataValue = default(object);
                        dblnError = !hwpDxf_ReadBas.BkDXFReadBas_XData(ref dlngIdx, mobjDictReadCodes, mobjDictReadValues, ref dvarXDataType, ref dvarXDataValue, ref nrstrErrMsg);
                        if (!dblnError)
                        {
                            mobjAcadDimStyles.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 (!InternReadDimStyle(ddblObjectID, ref dlngIdx, ref mobjAcadDimStyles, ref nrstrErrMsg))
                                {
                                    dblnError = true;
                                }
                            }
                        }
                    }
                    else
                    {
                        dblnError = true;
                    }
                }
                InternReadTable = !dblnError;
            }
            dobjDictXDictionary2 = null;
            dobjDictUnknown341   = null;
            return(InternReadTable);
        }