示例#1
0
        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);
        }
示例#2
0
        private void btn_movePoint_Click(object sender, EventArgs e)
        {
            IFSelection selection = lusas.getSelection();
            object      points    = selection.getObjects("points");

            object[] pointsArray = (object[])points;
            for (int i = 0; i < pointsArray.Length; i++)
            {
            }
        }
示例#3
0
        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);
        }