Esempio n. 1
0
        public dynCurveBySelection(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            //add a button to the inputGrid on the dynElement
            System.Windows.Controls.Button curveSelectButt = new System.Windows.Controls.Button();
            this.inputGrid.Children.Add(curveSelectButt);
            curveSelectButt.Margin = new System.Windows.Thickness(0, 0, 0, 0);
            curveSelectButt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            curveSelectButt.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            curveSelectButt.Click += new System.Windows.RoutedEventHandler(curveSelectButt_Click);
            curveSelectButt.Content = "Get Curve";

            //get the model curve selection
            //this.curve = SelectionHelper.RequestModelCurveSelection(Settings.Doc, "Select your a model curve.");

            this.Outputs.Add(this); //OutTips.Add("dynCurve");
            OutPortData.Add(new PortData("Crv", "The selected curve.", typeof(dynCurveBySelection)));
            //there are no inputs to this function, only the base curve output
            base.RegisterInputsAndOutputs();
        }
Esempio n. 2
0
        public dynCurvesByFaceGrid(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            //add the null inputs
            Inputs.Add(face_in);
            InPortData.Add(new PortData("F", "Face.", typeof(dynFaceBySelection)));
            Inputs.Add(u_in);
            InPortData.Add(new PortData("U", "Subdivisions in U direction", typeof(dynDouble)));
            Inputs.Add(v_in);
            InPortData.Add(new PortData("V", "Subdivisions in V direction.", typeof(dynDouble)));
            Inputs.Add(offset_in);
            InPortData.Add(new PortData("Off", "Face offset.", typeof(dynDouble)));

            base.RegisterInputsAndOutputs();
        }
Esempio n. 3
0
        public static Curve RequestModelCurveSelection(UIDocument doc, string message, dynElementSettings settings)
        {
            try
            {
                ModelCurve c = null;
                Curve cv = null;

                Selection choices = doc.Selection;

                choices.Elements.Clear();

                //MessageBox.Show(message);
                settings.Bench.Log(message);

                Reference curveRef = doc.Selection.PickObject(ObjectType.Element);

                c = curveRef.Element as ModelCurve;
                if (c != null)
                {
                    cv = c.GeometryCurve;
                }
                return cv;
            }
            catch (Exception ex)
            {
                settings.Bench.Log(ex.Message);
                return null;
            }
        }
Esempio n. 4
0
 public dynCurve(dynElementSettings settings, string nickName)
     : base(settings, nickName)
 {
     Inputs.Add(plane_in);
     InPortData.Add(new PortData("Pl", "The plane on which to create the curve.", typeof(dynPlane)));
     Outputs.Add(this);
     OutPortData.Add(new PortData("Crv", "The curve.", typeof(dynCurve)));
 }
Esempio n. 5
0
        public dynInstanceArray(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            instances = new List<FamilyInstance>();

            Inputs.Add(null);
            InPortData.Add(new PortData("PM", "The parameter map which defines the parameter values for these instances.",
                typeof(dynInstanceParameterMap)));

            Inputs.Add(null);
            InPortData.Add(new PortData("Face", "The face used to orient these instances.", typeof(dynFaceBySelection)));

            Outputs.Add(this);
            OutPortData.Add(new PortData("InstArr", "The dynInstanceArray created.", typeof(dynInstanceArray)));

            base.RegisterInputsAndOutputs();
        }
Esempio n. 6
0
 public dynPlane(dynElementSettings settings)
     : base(settings)
 {
 }
Esempio n. 7
0
 public dynVector(dynElementSettings settings)
     : base(settings)
 {
 }
Esempio n. 8
0
        public dynFaceBySelection(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            //add a button to the inputGrid on the dynElement
            System.Windows.Controls.Button faceSelectButt = new System.Windows.Controls.Button();
            this.inputGrid.Children.Add(faceSelectButt);
            faceSelectButt.Margin = new System.Windows.Thickness(0, 0, 0, 0);
            faceSelectButt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            faceSelectButt.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            faceSelectButt.Click += new System.Windows.RoutedEventHandler(faceSetlect_buttClick);
            faceSelectButt.Content = "Get Face";

            this.Outputs.Add(this);
            OutPortData.Add(new PortData("F", "The selected face.", typeof(dynFaceBySelection)));
            //there are no inputs to this function, only the base curve output
            base.RegisterInputsAndOutputs();
        }
Esempio n. 9
0
        public dynPointByXYZSimple(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            Inputs.Add(x);
            InPortData.Add(new PortData("X", "The X component of the point.", typeof(dynDouble)));
            Inputs.Add(y);
            InPortData.Add(new PortData("Y", "The Y component of the point.", typeof(dynDouble)));
            Inputs.Add(z);
            InPortData.Add(new PortData("Z", "The Z component of the point.", typeof(dynDouble)));

            base.RegisterInputsAndOutputs();
        }
Esempio n. 10
0
 public dynPointSimple(dynElementSettings settings)
     : base(settings)
 {
 }
Esempio n. 11
0
        public dynPointByParameterAlongCurve(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            Inputs.Add(t_in);
            InPortData.Add(new PortData("t", "The parameter along the curve.", typeof(dynDouble)));
            Inputs.Add(curve_in);
            InPortData.Add(new PortData("Crv", "The input curve.", typeof(dynCurve)));

            base.RegisterInputsAndOutputs();
        }
Esempio n. 12
0
 public dynPoint(dynElementSettings settings)
     : base(settings)
 {
     //empty constructor for non-gui point types
 }
Esempio n. 13
0
        public dynPoint(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            point = new XYZ();
            xyPlane_out = new dynPlane(settings);
            yzPlane_out = new dynPlane(settings);
            xzPlane_out = new dynPlane(settings);

            Outputs.Add(this);
            OutPortData.Add(new PortData("Pt", "The dynPoint.", typeof(dynPoint)));
            Outputs.Add(xyPlane_out);
            OutPortData.Add(new PortData("Pl", "The XY plane of the point.", typeof(dynPlane)));
            Outputs.Add(yzPlane_out);
            OutPortData.Add(new PortData("Pl", "The YZ plane of the point.", typeof(dynPlane)));
            Outputs.Add(xzPlane_out);
            OutPortData.Add(new PortData("Pl", "The XZ plane of the point.", typeof(dynPlane)));
        }
Esempio n. 14
0
 public dynCurveSimple(dynElementSettings settings)
     : base(settings)
 {
 }
Esempio n. 15
0
 public dynXYZArray(dynElementSettings settings)
     : base(settings)
 {
 }
Esempio n. 16
0
        public dynElementArray(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            elements = new List<dynElement>();

            Outputs.Add(this);
            OutPortData.Add(new PortData("Arr","The array of dynElements.", typeof(dynElementArray)));
        }
Esempio n. 17
0
        public static Face RequestFaceSelection(UIDocument doc, string message, dynElementSettings settings)
        {
            try
            {
                Face f = null;

                Selection choices = doc.Selection;

                choices.Elements.Clear();

                //MessageBox.Show(message);
                settings.Bench.Log(message);

                //create some geometry options so that we computer references
                Autodesk.Revit.DB.Options opts = new Options();
                opts.ComputeReferences = true;
                opts.DetailLevel = DetailLevels.Medium;
                opts.IncludeNonVisibleObjects = false;

                Reference faceRef = doc.Selection.PickObject(ObjectType.Face);

                if (faceRef != null)
                {
                    f = faceRef.GeometryObject as Face;
                    GeometryElement geom = faceRef.Element.get_Geometry(opts);
                    foreach (GeometryObject geob in geom.Objects)
                    {
                        Solid faceSolid = geob as Solid;

                        if(faceSolid != null)
                        {
                            foreach(Face testFace in faceSolid.Faces)
                            {
                                if(testFace.Area==f.Area)
                                {
                                    f=testFace;
                                }
                            }
                        }
                    }
                }
                return f;
            }
            catch (Exception ex)
            {
                settings.Bench.Log(ex.Message);
                return null;
            }
        }
Esempio n. 18
0
        public dynFamilySymbolBySelection(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            //add a button to the inputGrid on the dynElement
            System.Windows.Controls.Button elementSelectButt = new System.Windows.Controls.Button();
            this.inputGrid.Children.Add(elementSelectButt);
            elementSelectButt.Margin = new System.Windows.Thickness(0, 0, 0, 0);
            elementSelectButt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            elementSelectButt.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            elementSelectButt.Click += new System.Windows.RoutedEventHandler(elementSelectButt_Click);
            elementSelectButt.Content = "Symbol";

            this.Outputs.Add(this);
            OutPortData.Add(new PortData("FS", "The selected family symbol.", typeof(dynFamilySymbolBySelection)));

            base.RegisterInputsAndOutputs();
        }
Esempio n. 19
0
        public static FamilySymbol RequestFamilyInstanceSelection(UIDocument doc, string message, 
            dynElementSettings settings, ref FamilyInstance fi)
        {
            try
            {
                FamilySymbol fs = null;

                Selection choices = doc.Selection;

                choices.Elements.Clear();

                //MessageBox.Show(message);
                settings.Bench.Log(message);

                Reference fsRef = doc.Selection.PickObject(ObjectType.Element);

                if (fsRef != null)
                {
                    fi = fsRef.Element as FamilyInstance;

                    if (fi != null)
                    {
                        return fi.Symbol;
                    }
                    else return null;
                }
                else return null;
            }
            catch (Exception ex)
            {
                settings.Bench.Log(ex.Message);
                return null;
            }
        }
Esempio n. 20
0
        public dynInstanceParameterMap(dynElementSettings settings, string nickName)
            : base(settings, nickName)
        {
            map = new List<dynParamData>();

            Inputs.Add(fs_in);
            InPortData.Add(new PortData("FS", "The Family Symbol", typeof(dynFamilySymbolBySelection)));
            Inputs.Add(array_in);
            InPortData.Add(new PortData("Arr", "The dynElementArray which defines this map.", typeof(dynElementArray)));

            Outputs.Add(this);
            OutPortData.Add(new PortData("PM", "A map of parameters on the instance.", typeof(dynInstanceParameterMap)));

            //add a button to the inputGrid on the dynElement
            System.Windows.Controls.Button paramMapButt = new System.Windows.Controls.Button();
            this.inputGrid.Children.Add(paramMapButt);
            paramMapButt.Margin = new System.Windows.Thickness(0, 0, 0, 0);
            paramMapButt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            paramMapButt.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            paramMapButt.Click += new System.Windows.RoutedEventHandler(paramMapButt_Click);
            paramMapButt.Content = "Map";

            base.RegisterInputsAndOutputs();
        }
Esempio n. 21
0
 public dynArcByCenterAndAngles(dynElementSettings settings, string nickName)
     : base(settings, nickName)
 {
     //add the null inputs
     Inputs.Add(angle1_in);
     InPortData.Add(new PortData("A", "Angle 1.", typeof(dynDouble)));
     Inputs.Add(angle2_in);
     InPortData.Add(new PortData("A", "Angle 1.", typeof(dynDouble)));
     Inputs.Add(radius_in);
     InPortData.Add(new PortData("D", "The radius of the arc.", typeof(dynDouble)));
     base.RegisterInputsAndOutputs();
 }