Esempio n. 1
0
        private bool CreateCommon()
        {
            // Get reference planes
            List <ReferencePlane> planes = Utility.GetElements <ReferencePlane>(app, doc);

            foreach (ReferencePlane plane in planes)
            {
                if (plane.Name.Equals("Center (Front/Back)"))
                {
                    centerPlane = plane;
                }
                if (plane.Name.Equals("Top") || plane.Name.Equals("Head"))
                {
                    topPlane = plane;
                }
                if (plane.Name.Equals("Bottom") || plane.Name.Equals("Sill"))
                {
                    bottomPlane = plane;
                }
                if (plane.Name.Equals("Left"))
                {
                    leftPlane = plane;
                }
                if (plane.Name.Equals("Right"))
                {
                    rightPlane = plane;
                }
            }

            // Get views
            List <View> views = Utility.GetElements <View>(app, doc);

            foreach (View view in views)
            {
                if (view.Name.Equals("Right"))
                {
                    rightView = view;
                }
                if (view.Name.Equals("Left"))
                {
                    leftView = view;
                }
                if (view.Name.Equals("Exterior"))
                {
                    exteriorView = view;
                }
                if (view.Name.Equals("Interior"))
                {
                    interiorView = view;
                }
            }

            // Get Wall
            List <Wall> walls = Utility.GetElements <Wall>(app, doc);

            wall = walls[0];

            if (wall == null)
            {
                return(false);
            }

            // Get wall exterior face
            exteriorWallFace = GeoHelper.GetWallFace(wall, rightView, WallSide.Exterior);

            // Get wall interior face
            interiorWallFace = GeoHelper.GetWallFace(wall, rightView, WallSide.Interior);

            Debug.WriteLine("\n=======\n");
            Debug.WriteLine(String.Format("centerPlane: {0}", centerPlane));
            Debug.WriteLine(String.Format("topPlane: {0}", topPlane));
            Debug.WriteLine(String.Format("bottomPlane: {0}", bottomPlane));
            Debug.WriteLine(String.Format("wall: {0}", wall));
            Debug.WriteLine(String.Format("exteriorWallFace: {0}", exteriorWallFace));
            Debug.WriteLine(String.Format("interiorWallFace: {0}", interiorWallFace));
            Debug.WriteLine(String.Format("rightView: {0}", rightView));
            Debug.WriteLine(String.Format("leftView: {0}", leftView));

            return(true);
        }