Example #1
0
        public override void getNXInfo()
        {
            for (int i = 0; i < nx_RefGeoms.Length; i++)
            {
                if (nx_RefGeoms[i].ToString().Contains("Face"))
                {
                    Face          planarFace = (Face)nx_RefGeoms[i];
                    Face.FaceType faceType   = planarFace.SolidFaceType;
                    Edge[]        faceEdges  = planarFace.GetEdges();
                    Point3d[]     v1         = new Point3d[planarFace.GetEdges().Count()];
                    Point3d[]     v2         = new Point3d[planarFace.GetEdges().Count()];
                    for (int j = 0; j < planarFace.GetEdges().Count(); j++)
                    {
                        faceEdges[j].GetVertices(out v1[j], out v2[j]);
                        convertWorldToLocal LocalConv   = new convertWorldToLocal();
                        Point3d             localPoint1 = LocalConv.calculateLocalCoord(v1[j], refGeomPartPositions[i], refGeomPartOrientations[i]);
                        Point3d             localPoint2 = LocalConv.calculateLocalCoord(v2[j], refGeomPartPositions[i], refGeomPartOrientations[i]);

                        switch (i)
                        {
                        case 0:
                            NXrefPoints1.Add(localPoint1);
                            break;

                        case 1:
                            NXrefPoints2.Add(localPoint1);
                            break;
                        }
                    }
                }
            }
            ConstType = nxConst.ConstraintType.ToString();
        }
Example #2
0
        public override void getNXInfo()
        {
            for (int i = 0; i < nx_RefGeoms.Length; i++)
            {
                if (nx_RefGeoms[i].ToString().Contains("Face"))
                {
                    Face          tempconst = (Face)nx_RefGeoms[i];
                    Edge[]        circularedges = tempconst.GetEdges();
                    Edge          circularEdge = circularedges[0];
                    Edge.EdgeType edgeType = circularEdge.SolidEdgeType;
                    Point3d       a, b;
                    circularEdge.GetVertices(out a, out b); //a, b are same since circular edge starts and ends at same position

                    convertWorldToLocal worldToLocalConv = new convertWorldToLocal();
                    Point3d             tcad_Coord       = worldToLocalConv.calculateLocalCoord(a, refGeomPartPositions[i], refGeomPartOrientations[i]);

                    tcad_RefGeoms[i] = tcad_refGeomRelatedParts[i].SelectCurveBy3Points(tcad_Coord.X, tcad_Coord.Y, tcad_Coord.Z, tcad_Coord.X, tcad_Coord.Y, tcad_Coord.Z, tcad_Coord.X, tcad_Coord.Y, tcad_Coord.Z);
                    if (tcad_RefGeoms[i] == null)
                    {
                        tcad_RefGeoms[i] = tcad_refGeomRelatedParts[i].SelectCurveBy3Points(-tcad_Coord.X, tcad_Coord.Y, tcad_Coord.Z, -tcad_Coord.X, tcad_Coord.Y, tcad_Coord.Z, -tcad_Coord.X, tcad_Coord.Y, tcad_Coord.Z);
                    }
                }
            }
        }