コード例 #1
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static Node ToNode(this IFPoint lusasPoint,
                                  HashSet <string> groupNames, Dictionary <string, Constraint6DOF> constraint6DOFs)
        {
            HashSet <string> tags = new HashSet <string>(IsMemberOf(lusasPoint, groupNames));
            List <string>    supportAssignments = GetAttributeAssignments(lusasPoint, "Support");

            Constraint6DOF nodeConstraint = null;

            if (!(supportAssignments.Count() == 0))
            {
                constraint6DOFs.TryGetValue(supportAssignments[0], out nodeConstraint);
            }

            Node node = new Node
            {
                Position = new Point {
                    X = lusasPoint.getX(), Y = lusasPoint.getY(), Z = lusasPoint.getZ()
                },
                Name    = "",
                Support = nodeConstraint
            };

            node.Tags = tags;

            string adapterID = lusasPoint.getID().ToString();

            node.SetAdapterId(typeof(LusasId), adapterID);

            return(node);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: shemnor/ATK_LusasModeller
        public List <double[]> getPointCoordinatesFromLusas()
        {
            List <double[]> pointsCoordinates = new List <double[]>();
            IFSelection     userInp           = lusas.getSelection();
            object          points            = userInp.getObjects("points");

            object[] pointsArray = (object[])points;

            //check if selection is at least one point
            if (pointsArray.Length < 1)
            {
                MessageBox.Show("please select at least one point", "", MessageBoxButtons.OK);
                return(null);
            }

            for (int i = 0; i < pointsArray.Length; i++)
            {
                IFPoint  point    = (IFPoint)pointsArray[i];
                double[] position = new double[3];
                //point.getXYZ(ref position);
                position[0] = point.getX();
                position[1] = point.getY();
                position[2] = point.getZ();
                pointsCoordinates.Add(position);
            }

            return(pointsCoordinates);
        }
コード例 #3
0
ファイル: ToPoint.cs プロジェクト: BHoM/Lusas_Toolkit
        /***************************************************/

        public static Point ToPoint(this IFPoint lusasPoint)
        {
            Point point = new Point {
                X = lusasPoint.getX(), Y = lusasPoint.getY(), Z = lusasPoint.getZ()
            };

            return(point);
        }
コード例 #4
0
ファイル: ToPoint.cs プロジェクト: BHoM/Lusas_Toolkit
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static Point ToPoint(this IFPoint lusasPoint, HashSet <string> groupNames)
        {
            HashSet <string> tags = new HashSet <string>(IsMemberOf(lusasPoint, groupNames));

            Point point = new Point {
                X = lusasPoint.getX(), Y = lusasPoint.getY(), Z = lusasPoint.getZ()
            };

            return(point);
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: shemnor/ATK_LusasModeller
        public List <List <double[]> > getSurfaceCoordinatesFromLusas()
        {
            IFSelection userInp = lusas.getSelection();

            //check if selection is at least one point
            if (userInp.countSurfaces() < 1)
            {
                MessageBox.Show("please select at least one point", "", MessageBoxButtons.OK);
                return(null);
            }

            //create collection to popoulate surfaces
            List <List <double[]> > surfaces = new List <List <double[]> >();

            for (int i = 0; i < userInp.countSurfaces(); i++)
            {
                //gereate array of ids
                List <int> pointIds = new List <int>();

                //generate collection for populating vertices
                List <double[]> vertexes = new List <double[]>();

                IFSurface surface = userInp.getSurface(i);
                object[]  lines   = surface.getLOFs() as object[];
                for (int l = 0; l < lines.Length; l++)
                {
                    IFLine   line   = lines[l] as IFLine;
                    object[] points = line.getLOFs() as object[];
                    for (int k = 0; k < points.Length; k++)
                    {
                        IFPoint point = points[k] as IFPoint;
                        int     id    = point.getID();

                        if (!pointIds.Contains(id))
                        {
                            pointIds.Add(id);
                            double[] position = new double[3];
                            position[0] = point.getX();
                            position[1] = point.getY();
                            position[2] = point.getZ();
                            //point.getXYZ(position[0],position[1],position[2]);
                            vertexes.Add(position);
                        }
                    }
                }
                surfaces.Add(vertexes);
            }
            return(surfaces);
        }