Exemplo n.º 1
0
        public AcadGroup Add(string vstrName, string nvstrHandle = "")
        {
            double    ddblObjectID   = (Operators.CompareString(nvstrHandle, null, TextCompare: false) != 0) ? hwpDxf_Functions.BkDXF_HexToDbl(nvstrHandle) : (-1.0);
            string    dstrErrMsg     = default(string);
            AcadGroup dobjAcadGroup2 = FriendAddAcadObject(vstrName, ddblObjectID, ref dstrErrMsg);
            AcadGroup Add            = default(AcadGroup);

            if (dobjAcadGroup2 == null)
            {
                Information.Err().Raise(50000, "AcadGroups", "Das Objekt konnte nicht hinzugefügt werden.\n" + dstrErrMsg);
            }
            else
            {
                Add = dobjAcadGroup2;
            }
            dobjAcadGroup2 = null;
            return(Add);
        }
Exemplo n.º 2
0
        internal AcadGroup FriendAddAcadObject(string vstrName, double nvdblObjectID = -1.0, ref string nrstrErrMsg = "")
        {
            AcadGroup dobjAcadGroup3 = new AcadGroup();

            if (nvdblObjectID == -1.0)
            {
                nvdblObjectID = base.Database.FriendGetNextObjectID;
            }
            AcadGroup acadGroup = dobjAcadGroup3;

            acadGroup.Name = vstrName;
            acadGroup.FriendLetNodeParentID     = base.NodeID;
            acadGroup.FriendLetApplicationIndex = base.FriendGetApplicationIndex;
            acadGroup.FriendLetDocumentIndex    = base.FriendGetDocumentIndex;
            acadGroup.FriendLetDatabaseIndex    = base.FriendGetDatabaseIndex;
            acadGroup.FriendLetOwnerID          = base.ObjectID;
            AcadGroup  acadGroup2      = acadGroup;
            double     vdblObjectID    = nvdblObjectID;
            AcadObject nrobjAcadObject = dobjAcadGroup3;
            bool       flag            = acadGroup2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg);

            dobjAcadGroup3 = (AcadGroup)nrobjAcadObject;
            bool dblnValid = default(bool);

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

            if (dblnValid && FriendAddItem(vstrName, dobjAcadGroup3))
            {
                FriendAddAcadObject = dobjAcadGroup3;
            }
            dobjAcadGroup3 = null;
            return(FriendAddAcadObject);
        }