コード例 #1
0
        public static Plane GetVerticalPlaneFrom2Points(IModel model)
        {
            Plane plane = new Plane();

            //accessing the model
            IModelData modelData = model.GetModelData();
            IView      view      = model.GetActiveView();

            //selecting two nodes
            Common.IO.Log("Select TWO nodes representing a vertical plane");
            List <Node> selectedNodes = RFEMselectOps.selectNodes(model);

            if (selectedNodes.Count < 2)
            {
                Common.IO.Log("Less than TWO nodes selected");
                return(plane);
            }


            Vector3 point1 = RFEMgeomOps.XNAvectorFromNode(selectedNodes[0]);
            Vector3 point2 = RFEMgeomOps.XNAvectorFromNode(selectedNodes[1]);
            Vector3 point3 = new Vector3(point2.X, point2.Y, point2.Z + 1);

            return(new Plane(point1, point2, point3));
        }
コード例 #2
0
        public static List <Plane> GetHorizontalPlanesFromMultiplePoints(IModel model)
        {
            List <Plane> planes = new List <Plane>();

            //accessing the model
            IModelData modelData = model.GetModelData();
            IView      view      = model.GetActiveView();

            //selecting multiple nodes
            Common.IO.Log("Select ONE OR MULTIPLE nodes representing horizontal planes");
            List <Node> selectedNodes = RFEMselectOps.selectNodes(model);

            if (selectedNodes.Count < 1)
            {
                Common.IO.Log("Less than ONE nodes selected");
                return(planes);
            }

            foreach (Node selectedNode in selectedNodes)
            {
                Vector3 point1 = new Vector3(0, 0, selectedNode.Z);
                Vector3 point2 = new Vector3(1, 0, selectedNode.Z);
                Vector3 point3 = new Vector3(0, 1, selectedNode.Z);

                planes.Add(new Plane(point1, point2, point3));
            }

            return(planes);
        }
コード例 #3
0
        public static Plane GetPlaneFrom3Points(IModel model)
        {
            Plane plane = new Plane();

            //accessing the model
            IModelData modelData = model.GetModelData();
            IView      view      = model.GetActiveView();

            //selecting three nodes
            Common.IO.Log("Select THREE nodes representing a plane");
            List <Node> selectedNodes = RFEMselectOps.selectNodes(model);

            if (selectedNodes.Count < 3)
            {
                Common.IO.Log("Less than THREE nodes selected");
                return(plane);
            }


            Vector3 point1 = RFEMgeomOps.XNAvectorFromNode(selectedNodes[0]);
            Vector3 point2 = RFEMgeomOps.XNAvectorFromNode(selectedNodes[1]);
            Vector3 point3 = RFEMgeomOps.XNAvectorFromNode(selectedNodes[2]);

            return(new Plane(point1, point2, point3));
        }