Пример #1
0
 internal new void FriendQuit()
 {
     if (mblnOpened)
     {
         base.FriendQuit();
         mobjAcadPaperSpace  = null;
         mobjAcadModelSpace  = null;
         mobjAcadPaperSpace0 = null;
         mblnOpened          = false;
     }
 }
Пример #2
0
        internal AcadBlock FriendAddAcadObject(ref string nrstrErrMsg, string vstrName, double nvdblObjectID = -1.0)
        {
            AcadBlock dobjAcadBlock3 = new AcadBlock();

            if (nvdblObjectID == -1.0)
            {
                nvdblObjectID = base.Database.FriendGetNextObjectID;
            }
            AcadBlock acadBlock = dobjAcadBlock3;

            acadBlock.Name = vstrName;
            acadBlock.FriendLetNodeParentID     = base.NodeID;
            acadBlock.FriendLetApplicationIndex = base.FriendGetApplicationIndex;
            acadBlock.FriendLetDocumentIndex    = base.FriendGetDocumentIndex;
            acadBlock.FriendLetDatabaseIndex    = base.FriendGetDatabaseIndex;
            acadBlock.FriendLetOwnerID          = base.ObjectID;
            AcadBlock  acadBlock2      = acadBlock;
            double     vdblObjectID    = nvdblObjectID;
            AcadObject nrobjAcadObject = dobjAcadBlock3;
            bool       flag            = acadBlock2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg);

            dobjAcadBlock3 = (AcadBlock)nrobjAcadObject;
            bool       dblnValid = default(bool);
            AcadObject dobjAcadObject5;

            if (flag)
            {
                dblnValid = true;
                if (!hwpDxf_Vars.pblnReadDocument)
                {
                    if (dblnValid)
                    {
                        dobjAcadObject5 = acadBlock.FriendAddAcadObjectBlockBegin(ref nrstrErrMsg, -1.0, nvblnWithoutObjectID: false);
                        if (dobjAcadObject5 == null)
                        {
                            dblnValid = false;
                        }
                        dobjAcadObject5 = null;
                    }
                    if (dblnValid)
                    {
                        dobjAcadObject5 = acadBlock.FriendAddAcadObjectBlockEnd(ref nrstrErrMsg, -1.0, nvblnWithoutObjectID: false);
                        if (dobjAcadObject5 == null)
                        {
                            dblnValid = false;
                        }
                        dobjAcadObject5 = null;
                    }
                    if (dblnValid)
                    {
                        acadBlock.FriendNewEntityDictionaries();
                    }
                }
            }
            else
            {
                hwpDxf_Functions.BkDXF_DebugPrint(acadBlock.ObjectName + ": " + nrstrErrMsg);
            }
            acadBlock = null;
            AcadBlock FriendAddAcadObject = default(AcadBlock);

            if (dblnValid)
            {
                AcadTableRecord robjAcadTableRecord = dobjAcadBlock3;
                Add(ref robjAcadTableRecord, vstrName);
                dobjAcadBlock3 = (AcadBlock)robjAcadTableRecord;
                string left = Strings.UCase(vstrName);
                if (Operators.CompareString(left, Strings.UCase("*Model_Space"), TextCompare: false) == 0)
                {
                    if (mobjAcadModelSpace == null)
                    {
                        mobjAcadModelSpace = new AcadModelSpace();
                        mobjAcadModelSpace.FriendInit(ref dobjAcadBlock3);
                    }
                }
                else if (Operators.CompareString(left, Strings.UCase("*Paper_Space"), TextCompare: false) == 0)
                {
                    if (mobjAcadPaperSpace == null)
                    {
                        if (!hwpDxf_Vars.pblnReadDocument)
                        {
                            dobjAcadBlock3.BlockBegin.FriendLetIsPaperSpace = true;
                            dobjAcadBlock3.BlockEnd.FriendLetIsPaperSpace   = true;
                        }
                        mobjAcadPaperSpace = new AcadPaperSpace();
                        mobjAcadPaperSpace.FriendInit(ref dobjAcadBlock3);
                    }
                }
                else if (Operators.CompareString(left, Strings.UCase("*Paper_Space0"), TextCompare: false) == 0 && mobjAcadPaperSpace0 == null)
                {
                    mobjAcadPaperSpace0 = new AcadPaperSpace();
                    mobjAcadPaperSpace0.FriendInit(ref dobjAcadBlock3);
                }
                FriendAddAcadObject = dobjAcadBlock3;
            }
            dobjAcadObject5 = null;
            dobjAcadBlock3  = null;
            return(FriendAddAcadObject);
        }