コード例 #1
0
 internal void FriendAdd(ref AcadAttributeReference robjAcadAttributeReference)
 {
     robjAcadAttributeReference.FriendLetNodeParentID = base.NodeID;
     checked
     {
         mlngEntityIndex++;
         AcadAttributeReference acadAttributeReference = robjAcadAttributeReference;
         mobjDictEntities.Add("K" + Conversions.ToString(acadAttributeReference.ObjectID), acadAttributeReference.ObjectID);
         acadAttributeReference = null;
     }
 }
コード例 #2
0
        internal new void FriendQuit()
        {
            AcadAttributeReference dobjAcadAttributeReference2 = default(AcadAttributeReference);
            AcadDatabase           dobjAcadDatabase2;

            if (mblnOpened)
            {
                if (mobjDictEntities.Count > 0)
                {
                    dobjAcadDatabase2 = hwpDxf_Vars.pobjAcadDatabases.FriendGetItem(mlngDatabaseIndex);
                    if (dobjAcadDatabase2 != null)
                    {
                        object dvarObjectIDs = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(mobjDictEntities.Values));
                        int    num           = Information.LBound((Array)dvarObjectIDs);
                        int    num2          = Information.UBound((Array)dvarObjectIDs);
                        for (int dlngIdx = num; dlngIdx <= num2; dlngIdx = checked (dlngIdx + 1))
                        {
                            AcadDatabase acadDatabase = dobjAcadDatabase2;
                            double       vdblObjectID = Conversions.ToDouble(NewLateBinding.LateIndexGet(dvarObjectIDs, new object[1]
                            {
                                dlngIdx
                            }, null));
                            AcadObject robjAcadObject = dobjAcadAttributeReference2;
                            string     nrstrErrMsg    = "";
                            bool       flag           = acadDatabase.FriendObjectIdToObject(vdblObjectID, ref robjAcadObject, ref nrstrErrMsg);
                            dobjAcadAttributeReference2 = (AcadAttributeReference)robjAcadObject;
                            if (flag)
                            {
                                dobjAcadAttributeReference2.FriendQuit();
                                dobjAcadAttributeReference2 = null;
                            }
                        }
                    }
                }
                base.FriendQuit();
                mobjDictEntities = null;
                mblnOpened       = false;
            }
            dobjAcadAttributeReference2 = null;
            dobjAcadDatabase2           = null;
        }
コード例 #3
0
        public static void BkAcadEntity_RemoveReactorsID(ref AcadEntity robjAcadEntity, double vdblObjectID)
        {
            switch (robjAcadEntity.ObjectName)
            {
            case "AcDbEntity":
            {
                AcadEntity dobjAcadEntity2 = robjAcadEntity;
                dobjAcadEntity2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadEntity2 = null;
                break;
            }

            case "AcDbFace":
            {
                Acad3DFace dobjAcad3DFace2 = (Acad3DFace)robjAcadEntity;
                dobjAcad3DFace2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcad3DFace2 = null;
                break;
            }

            case "AcDb3dSolid":
            {
                Acad3DSolid dobjAcad3DSolid2 = (Acad3DSolid)robjAcadEntity;
                dobjAcad3DSolid2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcad3DSolid2 = null;
                break;
            }

            case "AcDbAttributeDefinition":
            {
                AcadAttribute dobjAcadAttribute2 = (AcadAttribute)robjAcadEntity;
                dobjAcadAttribute2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadAttribute2 = null;
                break;
            }

            case "AcDbAttribute":
            {
                AcadAttributeReference dobjAcadAttributeReference2 = (AcadAttributeReference)robjAcadEntity;
                dobjAcadAttributeReference2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadAttributeReference2 = null;
                break;
            }

            case "AcDbBlockEnd":
            {
                AcadBlockEnd dobjAcadBlockEnd2 = (AcadBlockEnd)robjAcadEntity;
                dobjAcadBlockEnd2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadBlockEnd2 = null;
                break;
            }

            case "AcDbBlockBegin":
            {
                AcadBlockBegin dobjAcadBlockBegin2 = (AcadBlockBegin)robjAcadEntity;
                dobjAcadBlockBegin2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadBlockBegin2 = null;
                break;
            }

            case "AcDbBlockReference":
            {
                AcadBlockReference dobjAcadBlockReference2 = (AcadBlockReference)robjAcadEntity;
                dobjAcadBlockReference2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadBlockReference2 = null;
                break;
            }

            case "AcDbCurve":
            {
                AcadCurve dobjAcadCurve2 = (AcadCurve)robjAcadEntity;
                dobjAcadCurve2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadCurve2 = null;
                break;
            }

            case "AcDb3dPolyline":
            {
                Acad3DPolyline dobjAcad3DPolyline2 = (Acad3DPolyline)robjAcadEntity;
                dobjAcad3DPolyline2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcad3DPolyline2 = null;
                break;
            }

            case "AcDbArc":
            {
                AcadArc dobjAcadArc2 = (AcadArc)robjAcadEntity;
                dobjAcadArc2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadArc2 = null;
                break;
            }

            case "AcDbCircle":
            {
                AcadCircle dobjAcadCircle2 = (AcadCircle)robjAcadEntity;
                dobjAcadCircle2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadCircle2 = null;
                break;
            }

            case "AcDbEllipse":
            {
                AcadEllipse dobjAcadEllipse2 = (AcadEllipse)robjAcadEntity;
                dobjAcadEllipse2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadEllipse2 = null;
                break;
            }

            case "AcDbLeader":
            {
                AcadLeader dobjAcadLeader2 = (AcadLeader)robjAcadEntity;
                dobjAcadLeader2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadLeader2 = null;
                break;
            }

            case "AcDbLine":
            {
                AcadLine dobjAcadLine2 = (AcadLine)robjAcadEntity;
                dobjAcadLine2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadLine2 = null;
                break;
            }

            case "AcDbPolyline":
            {
                AcadLWPolyline dobjAcadLWPolyline2 = (AcadLWPolyline)robjAcadEntity;
                dobjAcadLWPolyline2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadLWPolyline2 = null;
                break;
            }

            case "AcDb2dPolyline":
            {
                AcadPolyline dobjAcadPolyline2 = (AcadPolyline)robjAcadEntity;
                dobjAcadPolyline2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadPolyline2 = null;
                break;
            }

            case "AcDb2dVertex":
            {
                Acad2DVertex dobjAcad2DVertex2 = (Acad2DVertex)robjAcadEntity;
                dobjAcad2DVertex2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcad2DVertex2 = null;
                break;
            }

            case "AcDb3dPolylineVertex":
            {
                Acad3DVertex dobjAcad3DVertex2 = (Acad3DVertex)robjAcadEntity;
                dobjAcad3DVertex2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcad3DVertex2 = null;
                break;
            }

            case "AcDbPolygonMeshVertex":
            {
                AcadPolygonMeshVertex dobjAcadPolygonMeshVertex2 = (AcadPolygonMeshVertex)robjAcadEntity;
                dobjAcadPolygonMeshVertex2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadPolygonMeshVertex2 = null;
                break;
            }

            case "AcDbPolyFaceMeshVertex":
            {
                AcadPolyfaceMeshVertex dobjAcadPolyfaceMeshVertex2 = (AcadPolyfaceMeshVertex)robjAcadEntity;
                dobjAcadPolyfaceMeshVertex2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadPolyfaceMeshVertex2 = null;
                break;
            }

            case "AcDbFaceRecord":
            {
                AcadFaceRecord dobjAcadFaceRecord2 = (AcadFaceRecord)robjAcadEntity;
                dobjAcadFaceRecord2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadFaceRecord2 = null;
                break;
            }

            case "AcDbRay":
            {
                AcadRay dobjAcadRay2 = (AcadRay)robjAcadEntity;
                dobjAcadRay2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadRay2 = null;
                break;
            }

            case "AcDbSpline":
            {
                AcadSpline dobjAcadSpline2 = (AcadSpline)robjAcadEntity;
                dobjAcadSpline2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadSpline2 = null;
                break;
            }

            case "AcDbXline":
            {
                AcadXline dobjAcadXline2 = (AcadXline)robjAcadEntity;
                dobjAcadXline2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadXline2 = null;
                break;
            }

            case "AcDbHatch":
            {
                AcadHatch dobjAcadHatch2 = (AcadHatch)robjAcadEntity;
                dobjAcadHatch2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadHatch2 = null;
                break;
            }

            case "AcDbMInsertBlock":
            {
                AcadMInsertBlock dobjAcadMInsertBlock2 = (AcadMInsertBlock)robjAcadEntity;
                dobjAcadMInsertBlock2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadMInsertBlock2 = null;
                break;
            }

            case "AcDbMLine":
            {
                AcadMLine dobjAcadMLine2 = (AcadMLine)robjAcadEntity;
                dobjAcadMLine2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadMLine2 = null;
                break;
            }

            case "AcDbMText":
            {
                AcadMText dobjAcadMText2 = (AcadMText)robjAcadEntity;
                dobjAcadMText2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadMText2 = null;
                break;
            }

            case "AcDbPoint":
            {
                AcadPoint dobjAcadPoint2 = (AcadPoint)robjAcadEntity;
                dobjAcadPoint2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadPoint2 = null;
                break;
            }

            case "AcDbPolyFaceMesh":
            {
                AcadPolyfaceMesh dobjAcadPolyfaceMesh2 = (AcadPolyfaceMesh)robjAcadEntity;
                dobjAcadPolyfaceMesh2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadPolyfaceMesh2 = null;
                break;
            }

            case "AcDbPolygonMesh":
            {
                AcadPolygonMesh dobjAcadPolygonMesh2 = (AcadPolygonMesh)robjAcadEntity;
                dobjAcadPolygonMesh2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadPolygonMesh2 = null;
                break;
            }

            case "AcDbSequenceEnd":
            {
                AcadSequenceEnd dobjAcadSequenceEnd2 = (AcadSequenceEnd)robjAcadEntity;
                dobjAcadSequenceEnd2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadSequenceEnd2 = null;
                break;
            }

            case "AcDbShape":
            {
                AcadShape dobjAcadShape2 = (AcadShape)robjAcadEntity;
                dobjAcadShape2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadShape2 = null;
                break;
            }

            case "AcDbText":
            {
                AcadText dobjAcadText2 = (AcadText)robjAcadEntity;
                dobjAcadText2.FriendRemoveReactorsID(vdblObjectID);
                dobjAcadText2 = null;
                break;
            }

            case "AcDbTrace":
                if (Operators.CompareString(robjAcadEntity.DXFName, "TRACE", TextCompare: false) == 0)
                {
                    AcadTrace dobjAcadTrace2 = (AcadTrace)robjAcadEntity;
                    dobjAcadTrace2.FriendRemoveReactorsID(vdblObjectID);
                    dobjAcadTrace2 = null;
                }
                else
                {
                    AcadSolid dobjAcadSolid2 = (AcadSolid)robjAcadEntity;
                    dobjAcadSolid2.FriendRemoveReactorsID(vdblObjectID);
                    dobjAcadSolid2 = null;
                }
                break;

            default:
                try
                {
                    AcadUnknownEnt dobjAcadUnknownEnt2 = (AcadUnknownEnt)robjAcadEntity;
                    dobjAcadUnknownEnt2.FriendRemoveReactorsID(vdblObjectID);
                    dobjAcadUnknownEnt2 = null;
                }
                catch (Exception ex2)
                {
                    ProjectData.SetProjectError(ex2);
                    Exception ex = ex2;
                    ProjectData.ClearProjectError();
                }
                break;
            }
        }
コード例 #4
0
        public AcadAttributeReference Item(object vvarValue)
        {
            if (mobjDictEntities.Count > 0)
            {
                AcadDatabase dobjAcadDatabase = hwpDxf_Vars.pobjAcadDatabases.FriendGetItem(mlngDatabaseIndex);
                if (dobjAcadDatabase != null)
                {
                    AcadAttributeReference dobjAcadAttributeReference4 = default(AcadAttributeReference);
                    switch (Information.VarType(RuntimeHelpers.GetObjectValue(vvarValue)))
                    {
                    case VariantType.Double:
                    {
                        double ddblObjectID2 = Conversions.ToDouble(vvarValue);
                        if (mobjDictEntities.ContainsKey("K" + Conversions.ToString(ddblObjectID2)))
                        {
                            double     ddblCurObjectID2 = Conversions.ToDouble(mobjDictEntities["K" + Conversions.ToString(ddblObjectID2)]);
                            double     vdblObjectID3    = ddblCurObjectID2;
                            AcadObject robjAcadObject   = dobjAcadAttributeReference4;
                            string     nrstrErrMsg      = "";
                            bool       flag             = dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID3, ref robjAcadObject, ref nrstrErrMsg);
                            dobjAcadAttributeReference4 = (AcadAttributeReference)robjAcadObject;
                            if (flag)
                            {
                                return(dobjAcadAttributeReference4);
                            }
                        }
                        break;
                    }

                    case VariantType.String:
                    {
                        string vstrHexNum  = Conversions.ToString(vvarValue);
                        int    nrlngErrNum = 0;
                        string nrstrErrMsg = "";
                        if (!hwpDxf_Functions.BkDXF_ValidHexNum(vstrHexNum, ref nrlngErrNum, ref nrstrErrMsg))
                        {
                            break;
                        }
                        double ddblObjectID2 = hwpDxf_Functions.BkDXF_HexToDbl(Conversions.ToString(vvarValue));
                        if (mobjDictEntities.ContainsKey("K" + Conversions.ToString(ddblObjectID2)))
                        {
                            double     ddblCurObjectID2 = Conversions.ToDouble(mobjDictEntities["K" + Conversions.ToString(ddblObjectID2)]);
                            double     vdblObjectID2    = ddblCurObjectID2;
                            AcadObject robjAcadObject   = dobjAcadAttributeReference4;
                            nrstrErrMsg = "";
                            bool flag = dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID2, ref robjAcadObject, ref nrstrErrMsg);
                            dobjAcadAttributeReference4 = (AcadAttributeReference)robjAcadObject;
                            if (flag)
                            {
                                return(dobjAcadAttributeReference4);
                            }
                        }
                        break;
                    }

                    case VariantType.Short:
                    case VariantType.Integer:
                    {
                        int dlngIndex = Conversions.ToInteger(vvarValue);
                        if ((dlngIndex >= 0) & (dlngIndex < mobjDictEntities.Count))
                        {
                            object dvarObjectIDs = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(mobjDictEntities.Values));
                            double vdblObjectID  = Conversions.ToDouble(NewLateBinding.LateIndexGet(dvarObjectIDs, new object[1]
                                {
                                    dlngIndex
                                }, null));
                            AcadObject robjAcadObject = dobjAcadAttributeReference4;
                            string     nrstrErrMsg    = "";
                            bool       flag           = dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID, ref robjAcadObject, ref nrstrErrMsg);
                            dobjAcadAttributeReference4 = (AcadAttributeReference)robjAcadObject;
                            if (flag)
                            {
                                return(dobjAcadAttributeReference4);
                            }
                        }
                        break;
                    }
                    }
                }
            }
            AcadAttributeReference Item = default(AcadAttributeReference);

            return(Item);
        }
コード例 #5
0
        internal object FriendGetMinMaxCoords()
        {
            object dvarItems     = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(mobjDictEntities.Values));
            int    num           = Information.LBound((Array)dvarItems);
            int    num2          = Information.UBound((Array)dvarItems);
            bool   dblnFirst     = default(bool);
            object dvarMaxCoordX = default(object);
            object dvarMaxCoordY = default(object);
            object dvarMinCoordX = default(object);
            object dvarMinCoordY = default(object);
            AcadAttributeReference dobjObject = default(AcadAttributeReference);

            for (int dlngIdx = num; dlngIdx <= num2; dlngIdx = checked (dlngIdx + 1))
            {
                double ddblCurObjectID = Conversions.ToDouble(NewLateBinding.LateIndexGet(dvarItems, new object[1]
                {
                    dlngIdx
                }, null));
                AcadDatabase database       = Database;
                AcadObject   robjAcadObject = dobjObject;
                string       nrstrErrMsg    = "";
                database.FriendObjectIdToObject(ddblCurObjectID, ref robjAcadObject, ref nrstrErrMsg);
                dobjObject = (AcadAttributeReference)robjAcadObject;
                object dvarMinMaxCoords = RuntimeHelpers.GetObjectValue(dobjObject.MinMaxCoords);
                if (dvarMinMaxCoords == null)
                {
                    continue;
                }
                if (!dblnFirst)
                {
                    dvarMaxCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        0
                    }, null));
                    dvarMaxCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        1
                    }, null));
                    dvarMinCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        2
                    }, null));
                    dvarMinCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        3
                    }, null));
                    dblnFirst = true;
                    continue;
                }
                if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                {
                    0
                }, null), dvarMaxCoordX, TextCompare: false))
                {
                    dvarMaxCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        0
                    }, null));
                }
                if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                {
                    1
                }, null), dvarMaxCoordY, TextCompare: false))
                {
                    dvarMaxCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        1
                    }, null));
                }
                if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                {
                    2
                }, null), dvarMinCoordX, TextCompare: false))
                {
                    dvarMinCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        2
                    }, null));
                }
                if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                {
                    3
                }, null), dvarMinCoordY, TextCompare: false))
                {
                    dvarMinCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1]
                    {
                        3
                    }, null));
                }
            }
            object FriendGetMinMaxCoords = (!dblnFirst) ? null : new object[4]
            {
                dvarMaxCoordX,
                dvarMaxCoordY,
                dvarMinCoordX,
                dvarMinCoordY
            };

            dobjObject = null;
            return(FriendGetMinMaxCoords);
        }