Пример #1
0
        internal Acad3DVertex FriendAppendVertex(double vdblObjectID, object vvar3DVertex, ref string nrstrErrMsg)
        {
            object[] dadecCoordinate = new object[3];
            double[] dadblCoordinate = new double[3];
            nrstrErrMsg = null;
            bool flag = false;

            dadblCoordinate[0] = Conversions.ToDouble(NewLateBinding.LateIndexGet(vvar3DVertex, new object[1]
            {
                0
            }, null));
            dadblCoordinate[1] = Conversions.ToDouble(NewLateBinding.LateIndexGet(vvar3DVertex, new object[1]
            {
                1
            }, null));
            dadblCoordinate[2] = Conversions.ToDouble(NewLateBinding.LateIndexGet(vvar3DVertex, new object[1]
            {
                2
            }, null));
            Acad3DVertex dobjAcad3DVertex3 = new Acad3DVertex();
            Acad3DVertex acad3DVertex      = dobjAcad3DVertex3;

            acad3DVertex.FriendLetCoordinate       = RuntimeHelpers.GetObjectValue(Interaction.IIf(Expression: false, dadecCoordinate, dadblCoordinate));
            acad3DVertex.FriendLetNodeParentID     = base.NodeID;
            acad3DVertex.FriendLetApplicationIndex = base.FriendGetApplicationIndex;
            acad3DVertex.FriendLetDocumentIndex    = base.FriendGetDocumentIndex;
            acad3DVertex.FriendLetDatabaseIndex    = base.FriendGetDatabaseIndex;
            acad3DVertex.FriendLetOwnerID          = base.ObjectID;
            Acad3DVertex acad3DVertex2   = acad3DVertex;
            AcadObject   nrobjAcadObject = dobjAcad3DVertex3;
            bool         flag2           = acad3DVertex2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg);

            dobjAcad3DVertex3 = (Acad3DVertex)nrobjAcadObject;
            if (flag2)
            {
                bool dblnValid = true;
            }
            else
            {
                hwpDxf_Functions.BkDXF_DebugPrint(acad3DVertex.ObjectName + ": " + nrstrErrMsg);
            }
            acad3DVertex = null;
            mobjDictVertices.Add("K" + Conversions.ToString(mobjDictVertices.Count), dobjAcad3DVertex3);
            if (checked (mobjDictVertices.Count - 1) == 0)
            {
                base.FriendLetStartPoint = RuntimeHelpers.GetObjectValue(dobjAcad3DVertex3.Coordinate);
            }
            base.FriendLetEndPoint = RuntimeHelpers.GetObjectValue(dobjAcad3DVertex3.Coordinate);
            InternCalcSize();
            Acad3DVertex FriendAppendVertex = dobjAcad3DVertex3;

            dobjAcad3DVertex3 = null;
            return(FriendAppendVertex);
        }
Пример #2
0
        public Acad3DVertex AppendVertex(object vvarVertex, string nvstrHandle = null)
        {
            string       dstrErrMsg   = default(string);
            Acad3DVertex AppendVertex = default(Acad3DVertex);
            Acad3DVertex dobjAcad3DVertex2;

            if (!hwpDxf_Functions.BkDXF_CheckVariantForArrayReal(RuntimeHelpers.GetObjectValue(vvarVertex), 0, 2, ref dstrErrMsg))
            {
                Information.Err().Raise(50000, "Acad3DPolyline", dstrErrMsg);
            }
            else
            {
                double ddblObjectID = (Operators.CompareString(nvstrHandle, null, TextCompare: false) != 0) ? hwpDxf_Functions.BkDXF_HexToDbl(nvstrHandle) : base.Database.FriendGetNextObjectID;
                object dvar3DVertex = RuntimeHelpers.GetObjectValue(InternCreate3DVertex(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(vvarVertex, new object[1]
                {
                    0
                }, null)), RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(vvarVertex, new object[1]
                {
                    1
                }, null)), RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(vvarVertex, new object[1]
                {
                    2
                }, null)), mobjDictVertices.Count == 0));
                dobjAcad3DVertex2 = FriendAppendVertex(ddblObjectID, RuntimeHelpers.GetObjectValue(dvar3DVertex), ref dstrErrMsg);
                if (dobjAcad3DVertex2 == null)
                {
                    Information.Err().Raise(50000, "Acad3DPolyline", "Der Kontrollpunkt konnte nicht hinzugefügt werden.\n" + dstrErrMsg);
                }
                else
                {
                    AppendVertex = dobjAcad3DVertex2;
                }
            }
            dobjAcad3DVertex2 = null;
            return(AppendVertex);
        }
Пример #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
        private void InternCalcSeg(bool vblnFirst, Acad3DVertex dobjFirstAcad3DVertex, Acad3DVertex dobjSecondAcad3DVertex, ref object rvarLen, bool vblnCalcLen, bool vblnIgnoreBulg)
        {
            object[] dadecPoint1 = new object[3];
            double[] dadblPoint1 = new double[3];
            object[] dadecPoint2 = new object[3];
            double[] dadblPoint2 = new double[3];
            rvarLen = 0m;
            bool   flag        = false;
            double ddblCoordX1 = Conversions.ToDouble(dobjFirstAcad3DVertex.CoordX);
            double ddblCoordY1 = Conversions.ToDouble(dobjFirstAcad3DVertex.CoordY);
            double ddblCoordZ1 = Conversions.ToDouble(dobjFirstAcad3DVertex.CoordZ);
            double ddblCoordX2 = Conversions.ToDouble(dobjSecondAcad3DVertex.CoordX);
            double ddblCoordY2 = Conversions.ToDouble(dobjSecondAcad3DVertex.CoordY);
            double ddblCoordZ2 = Conversions.ToDouble(dobjSecondAcad3DVertex.CoordZ);

            if (vblnFirst)
            {
                bool flag2 = false;
                mdblMaxCoordX = ddblCoordX1;
                mdblMinCoordX = ddblCoordX1;
                mdblMaxCoordY = ddblCoordY1;
                mdblMinCoordY = ddblCoordY1;
                mdblMaxCoordZ = ddblCoordZ1;
                mdblMinCoordZ = ddblCoordZ1;
            }
            else
            {
                bool flag3 = false;
                if (ddblCoordX1 > mdblMaxCoordX)
                {
                    mdblMaxCoordX = ddblCoordX1;
                }
                if (ddblCoordX1 < mdblMinCoordX)
                {
                    mdblMinCoordX = ddblCoordX1;
                }
                if (ddblCoordY1 > mdblMaxCoordY)
                {
                    mdblMaxCoordY = ddblCoordY1;
                }
                if (ddblCoordY1 < mdblMinCoordY)
                {
                    mdblMinCoordY = ddblCoordY1;
                }
                if (ddblCoordZ1 > mdblMaxCoordZ)
                {
                    mdblMaxCoordZ = ddblCoordZ1;
                }
                if (ddblCoordZ1 < mdblMinCoordZ)
                {
                    mdblMinCoordZ = ddblCoordZ1;
                }
            }
            bool flag4 = false;

            dadblPoint1[0] = ddblCoordX1;
            dadblPoint1[1] = ddblCoordY1;
            dadblPoint1[2] = ddblCoordZ1;
            dadblPoint2[0] = ddblCoordX2;
            dadblPoint2[1] = ddblCoordY2;
            dadblPoint2[2] = ddblCoordZ2;
            if (vblnCalcLen)
            {
                bool flag5 = false;
                rvarLen = RuntimeHelpers.GetObjectValue(hwpDxf_Vars.pobjUtilMath.LineLength(dadblPoint1, dadblPoint2));
            }
        }