Exemplo n.º 1
0
        internal AcadViewport FriendAddAcadObject(string vstrName, double nvdblObjectID = -1.0, ref string nrstrErrMsg = "")
        {
            AcadViewport dobjAcadViewport4 = new AcadViewport();

            if (nvdblObjectID == -1.0)
            {
                nvdblObjectID = base.Database.FriendGetNextObjectID;
            }
            AcadViewport acadViewport = dobjAcadViewport4;

            acadViewport.Name = vstrName;
            acadViewport.FriendLetNodeParentID     = base.NodeID;
            acadViewport.FriendLetDatabaseIndex    = base.FriendGetDatabaseIndex;
            acadViewport.FriendLetDocumentIndex    = base.FriendGetDocumentIndex;
            acadViewport.FriendLetApplicationIndex = base.FriendGetApplicationIndex;
            acadViewport.FriendOpen();
            acadViewport.FriendLetOwnerID = base.ObjectID;
            AcadViewport acadViewport2   = acadViewport;
            double       vdblObjectID    = nvdblObjectID;
            AcadObject   nrobjAcadObject = dobjAcadViewport4;
            bool         flag            = acadViewport2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg);

            dobjAcadViewport4 = (AcadViewport)nrobjAcadObject;
            bool dblnValid = default(bool);

            if (flag)
            {
                dblnValid = true;
            }
            else
            {
                hwpDxf_Functions.BkDXF_DebugPrint(acadViewport.ObjectName + ": " + nrstrErrMsg);
            }
            acadViewport = null;
            AcadViewport FriendAddAcadObject = default(AcadViewport);

            if (dblnValid)
            {
                AcadTableRecord robjAcadTableRecord = dobjAcadViewport4;
                Add(ref robjAcadTableRecord, vstrName);
                dobjAcadViewport4   = (AcadViewport)robjAcadTableRecord;
                mlngActiveIndex     = dobjAcadViewport4.TableIndex;
                FriendAddAcadObject = dobjAcadViewport4;
            }
            dobjAcadViewport4 = null;
            return(FriendAddAcadObject);
        }