应用程序:PlaceFamilyInstanceByFace

Revit平台:所有

Revit版本:2011.0

首次发布:2009.0

编程语言:C#

技能水平:中级

类别:

类型:ExternalCommand

主题:在面上创建族实例。

概要:

该示例演示了如何在面上创建族实例。

类:

Autodesk.Revit.UI.IExternalCommand

Autodesk.Revit.DB.FamilySymbol

Autodesk.Revit.DB.FamilyInstance

Autodesk.Revit.DB.Face

Autodesk.Revit.DB.Options

Autodesk.Revit.DB.Solid

项目文件:

Command.cs

该文件包含继承自IExternalCommand接口并实现Execute方法的Command类。

 

FamilyInstanceCreator.cs

这是创建面向族实例的主要数据类。它包含Revit中的所有操作。

 

PointUserControl.cs

该类定义了一个用户控件,用于指定点数据,其中包含三个文本框,用于指定点的XYZ坐标。

 

BasedType.cs

该类包含一个对话框,提供两个选项供用户选择创建族实例的类型。它提供两种类型:基于点和基于线。

 

PlaceFamilyInstanceForm.cs

该文件包含一个对话框,提供选项来指定族实例将放置在哪个面和位置上。

描述:

该示例将演示如何在面上创建族实例。

说明:

1. 绘制一些具有面几何的元素。

2. 选择一个元素并执行命令。

3. “基于类型”对话框中选择一种类型并单击“下一步”按钮。

4. 指定面、族符号和位置信息。

5. 单击“创建”按钮创建一个族实例。

注意事项:

1. 准备Revit项目。打开或新建一个Revit项目,并确保其中有一些面向和基于点的族符号。示例项目文件PlaceFamilyInstanceByFace.rvt可在示例文件夹中找到。

2. 目前在API中没有很好的方法来检查族符号是面向的还是基于点/基于线的。用户必须清楚地了解所选的族符号以创建族实例。如果创建失败,示例将跳过验证并提供消息。

3. 默认的族符号是此示例中提供的。 (线: “基于线”;点: “基于点”)

4. 起始点的默认值是所选面的最小点。结束点的默认值是所选面的最大点。

5. 位置点的默认值是所选面的边界框中心点。

6. 如果直接在Revit中使用此示例的DLL,请将rfa文件复制到Revit安装文件夹中或将其加载到当前文档中。调试此项目时无需进行任何操作。

源代码

完整的源代码请加入QQ群649037449,在群文件中下载RevitSDK.exe,解压后在文件夹中搜索本文中应用程序名称即可获得完整源码

FamilyInstanceCreator.cs

//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Autodesk.Revit;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

using GeoInstance = Autodesk.Revit.DB.GeometryInstance;
using GeoElement = Autodesk.Revit.DB.GeometryElement;
using RevitElement = Autodesk.Revit.DB.Element;

namespace Revit.SDK.Samples.PlaceFamilyInstanceByFace.CS
{
   /// <summary>
   /// This is main data class for creating family Instance by face
   /// </summary>
   public class FamilyInstanceCreator
   {
      #region Fields
      // Revit document
      private UIDocument m_revitDoc;
      // Creation application
      private Autodesk.Revit.Creation.Application m_appCreator;
      // all face names
      private List<String> m_faceNameList = new List<String>();
      // all face instances
      private List<Face> m_faceList = new List<Face>();
      // all family symbols
      private List<FamilySymbol> m_familySymbolList = new List<FamilySymbol>();
      // all family symbol names
      private List<String> m_familySymbolNameList = new List<String>();
      // the index default family symbol in family list
      private int m_defaultIndex = -1;
      #endregion

      #region Properties
      /// <summary>
      /// Store the all face names, they will be displayed in a combo box
      /// </summary>
      public List<String> FaceNameList
      {
         get
         {
            return m_faceNameList;
         }
      }

      /// <summary>
      /// Revit document
      /// </summary>
      public UIDocument RevitDoc
      {
         get
         {
            return m_revitDoc;
         }
      }

      /// <summary>
      /// Store all face instances for convenience to create a face-based family instance 
      /// </summary>
      public List<Face> FaceList
      {
         get
         {
            return m_faceList;
         }
      }

      /// <summary>
      /// Store all family symbol in current Revit document
      /// </summary>
      public List<FamilySymbol> FamilySymbolList
      {
         get
         {
            return m_familySymbolList;
         }
      }

      /// <summary>
      /// Store all family symbol names
      /// </summary>
      public List<String> FamilySymbolNameList
      {
         get
         {
            return m_familySymbolNameList;
         }
      }

      /// <summary>
      /// The index of default family symbol, will set it as default value when initializing UI 
      /// For based point, its name is "Point-based"
      /// For based line, its name is "Line-based"
      /// The prepared rfa files provide them 
      /// </summary>
      public int DefaultFamilySymbolIndex
      {
         get
         {
            return m_defaultIndex;
         }
      }

      #endregion

      #region Constructor
      /// <summary>
      /// Constructor, Store the Revit application
      /// </summary>
      /// <param name="app"></param>
      public FamilyInstanceCreator(Autodesk.Revit.UI.UIApplication app)
      {
         m_revitDoc = app.ActiveUIDocument;
         m_appCreator = app.Application.Create;
         if (!CheckSelectedElementSet())
         {
            throw new Exception("Please select an element with face geometry.");
         }
      }
      #endregion

      #region Public methods
      /// <summary>
      /// 1. Find all family symbols in current Revit document and store them
      /// 2. Find the index of default family symbol
      /// Point("Point-based"); Line("Line-based")
      /// </summary>
      public void CheckFamilySymbol(BasedType type)
      {
         m_defaultIndex = -1;
         m_familySymbolList.Clear();

         Autodesk.Revit.DB.FilteredElementIterator familySymbolItor =
             new FilteredElementCollector(m_revitDoc.Document).OfClass(typeof(FamilySymbol)).GetElementIterator();

         String defaultSymbolName = String.Empty;
         switch (type)
         {
            case BasedType.Point:
               defaultSymbolName = "Point-based";
               break;
            case BasedType.Line:
               defaultSymbolName = "Line-based";
               break;
            default:
               break;
         }

         bool hasDefaultSymbol = false;
         int ii = 0;

         while (familySymbolItor.MoveNext())
         {
            FamilySymbol symbol = (FamilySymbol)familySymbolItor.Current;
            if (null == symbol)
            {
               continue;
            }

            if (!hasDefaultSymbol && 0 == String.Compare(defaultSymbolName, symbol.Name))
            {
               hasDefaultSymbol = true;
               m_defaultIndex = ii;
            }

            // family symbol
            m_familySymbolList.Add(symbol);

            // family symbol name
            String familyCategoryname = String.Empty;
            if (null != symbol.Family.FamilyCategory)
            {
               familyCategoryname = symbol.Family.FamilyCategory.Name + " : ";
            }
            m_familySymbolNameList.Add(String.Format("{0}{1} : {2}"
                , familyCategoryname, symbol.Family.Name, symbol.Name));
            ii++;
         }

         if (!hasDefaultSymbol)
         {
            FamilySymbol loadedfamilySymbol = null;
            try
            {
               m_revitDoc.Document.LoadFamilySymbol(String.Format(@"{0}.rfa", defaultSymbolName)
                   , defaultSymbolName
                   , out loadedfamilySymbol);
            }
            catch (Exception)
            {
               TaskDialog.Show("Revit", "Can't load the prepared rfa.");
            }


            if (null == loadedfamilySymbol)
            {
               return;
            }
            m_familySymbolList.Add(loadedfamilySymbol);

            String familyCategoryname = String.Empty;
            if (null != loadedfamilySymbol.Family.FamilyCategory)
            {
               familyCategoryname = loadedfamilySymbol.Family.FamilyCategory.Name + ": ";
            }
            m_familySymbolNameList.Add(String.Format("{0}{1}: {2}"
                , familyCategoryname, loadedfamilySymbol.Family.Name, loadedfamilySymbol.Name));
            m_defaultIndex = m_familySymbolList.Count - 1;
         }

         return;
      }

      /// <summary>
      /// Create a based-point family instance by face
      /// </summary>
      /// <param name="locationP">the location point</param>
      /// <param name="directionP">the direction</param>
      /// <param name="faceIndex">the index of the selected face</param>
      /// <param name="familySymbolIndex">the index of the selected family symbol</param>
      /// <returns></returns>
      public bool CreatePointFamilyInstance(Autodesk.Revit.DB.XYZ locationP, Autodesk.Revit.DB.XYZ directionP, int faceIndex
          , int familySymbolIndex)
      {
         Face face = m_faceList[faceIndex];

         if (!m_familySymbolList[familySymbolIndex].IsActive)
            m_familySymbolList[familySymbolIndex].Activate();

         FamilyInstance instance = m_revitDoc.Document.Create.NewFamilyInstance(face
             , locationP, directionP, m_familySymbolList[familySymbolIndex]);

         List<ElementId> instanceId = new List<ElementId>();
         instanceId.Add(instance.Id);
         m_revitDoc.Selection.SetElementIds(instanceId);
         return true;
      }

      /// <summary>
      /// Create a based-line family instance by face
      /// </summary>
      /// <param name="startP">the start point</param>
      /// <param name="endP">the end point</param>
      /// <param name="faceIndex">the index of the selected face</param>
      /// <param name="familySymbolIndex">the index of the selected family symbol</param>
      /// <returns></returns>
      public bool CreateLineFamilyInstance(Autodesk.Revit.DB.XYZ startP, Autodesk.Revit.DB.XYZ endP, int faceIndex
          , int familySymbolIndex)
      {
         Face face = m_faceList[faceIndex];
         Autodesk.Revit.DB.XYZ projectedStartP = Project(face.Triangulate().Vertices as List<XYZ>, startP);
         Autodesk.Revit.DB.XYZ projectedEndP = Project(face.Triangulate().Vertices as List<XYZ>, endP);

         if (projectedStartP.IsAlmostEqualTo(projectedEndP))
         {
            return false;
         }

         Line line = Line.CreateBound(projectedStartP, projectedEndP);
         if (!m_familySymbolList[familySymbolIndex].IsActive)
            m_familySymbolList[familySymbolIndex].Activate();
         FamilyInstance instance = m_revitDoc.Document.Create.NewFamilyInstance(face, line
             , m_familySymbolList[familySymbolIndex]);

         List<ElementId> instanceId = new List<ElementId>();
         instanceId.Add(instance.Id);
         m_revitDoc.Selection.SetElementIds(instanceId);
         return true;
      }

      /// <summary>
      /// Judge whether the selected elementSet has face geometry
      /// </summary>
      /// <returns>true is having face geometry, false is having no face geometry</returns>
      public bool CheckSelectedElementSet()
      {
         // judge whether an or more element is selected
         ElementSet es = new ElementSet();
         foreach (ElementId elementId in m_revitDoc.Selection.GetElementIds())
         {
            es.Insert(m_revitDoc.Document.GetElement(elementId));
         }
         if (1 != es.Size)
         {
            return false;
         }

         m_faceList.Clear();
         m_faceNameList.Clear();

         // judge whether the selected element has face geometry
         foreach (Autodesk.Revit.DB.ElementId elemId in m_revitDoc.Selection.GetElementIds())
         {
            Autodesk.Revit.DB.Element elem = m_revitDoc.Document.GetElement(elemId);
            CheckSelectedElement(elem);
            break;
         }

         if (0 >= m_faceList.Count)
         {
            return false;
         }

         return true;
      }
      #endregion

      #region Private Methods
      /// <summary>
      /// Get the bounding box of a face, the BoundingBoxXYZ will be set in UI as default value
      /// </summary>
      /// <param name="indexFace">the index of face</param>
      /// <returns>the bounding box</returns>
      public BoundingBoxXYZ GetFaceBoundingBox(int indexFace)
      {
         Mesh mesh = m_faceList[indexFace].Triangulate();

         Autodesk.Revit.DB.XYZ maxP = new Autodesk.Revit.DB.XYZ(double.MinValue, double.MinValue, double.MinValue);
         Autodesk.Revit.DB.XYZ minP = new Autodesk.Revit.DB.XYZ(double.MaxValue, double.MaxValue, double.MaxValue);
         foreach (Autodesk.Revit.DB.XYZ tempXYZ in mesh.Vertices)
         {

            minP = new XYZ(
                Math.Min(minP.X, tempXYZ.X),
                Math.Min(minP.Y, tempXYZ.Y),
                Math.Min(minP.Z, tempXYZ.Z));

            maxP = new XYZ(
                Math.Max(maxP.X, tempXYZ.X),
                Math.Max(maxP.Y, tempXYZ.Y),
                Math.Max(maxP.Z, tempXYZ.Z));
         }

         BoundingBoxXYZ retBounding = new BoundingBoxXYZ();
         retBounding.Max = maxP;
         retBounding.Min = minP;
         return retBounding;
      }

      /// <summary>
      /// Judge whether an element has face geometry
      /// </summary>
      /// <param name="elem">the element to be checked</param>
      /// <returns>true is having face geometry, false is having no face geometry</returns>
      private bool CheckSelectedElement(RevitElement elem)
      {
         if (null == elem)
         {
            return false;
         }
         Autodesk.Revit.DB.Options opts = new Autodesk.Revit.DB.Options();
         opts.View = m_revitDoc.Document.ActiveView;
         opts.ComputeReferences = true;
         // Get geometry of the element
         GeoElement geoElement = elem.get_Geometry(opts);
         InquireGeometry(geoElement, elem);

         return true;
      }

      /// <summary>
      /// Inquire an geometry element to get all face instances
      /// </summary>
      /// <param name="geoElement">the geometry element</param>
      /// <param name="elem">the element, it provides the prefix of face name</param>
      /// <returns></returns>
      private bool InquireGeometry(GeoElement geoElement, RevitElement elem)
      {
         if (null == geoElement || null == elem)
         {
            return false;
         }

         //GeometryObjectArray geoArray = null;
         IEnumerator<GeometryObject> Objects = geoElement.GetEnumerator();
         //if (null != geoElement && null != geoElement.Objects)
         if (null != geoElement && Objects.MoveNext())
         {
            //geoArray = geoElement.Objects;
         }
         else
         {
            return false;
         }

         Objects.Reset();
         //foreach (GeometryObject obj in geoArray)
         while (Objects.MoveNext())
         {
            GeometryObject obj = Objects.Current;

            if (obj is GeoInstance)
            {
               GeoInstance instance = (GeoInstance)obj;
               InquireGeometry(instance.SymbolGeometry, elem);
            }
            else if (!(obj is Solid))
            {
               // is not Solid instance
               continue;
            }

            // continue when obj is Solid instance
            Solid solid = obj as Solid;
            if (null == solid)
            {
               continue;
            }
            FaceArray faces = solid.Faces;
            if (faces.IsEmpty)
            {
               continue;
            }

            // get the face name list
            String category = String.Empty;
            if (null != elem.Category && null != elem.Name)
            {
               category = elem.Category.Name;
            }

            int ii = 0;
            foreach (Face tempFace in faces)
            {
               if (tempFace is PlanarFace)
               {
                  m_faceNameList.Add(
                      String.Format("{0} : {1} ({2})", category, elem.Name, ii));
                  m_faceList.Add(tempFace);
                  ii++;
               }
            }
         }
         return true;
      }

      /// <summary>
      /// Project a point on a face
      /// </summary>
      /// <param name="xyzArray">the face points, them fix a face </param>
      /// <param name="point">the point</param>
      /// <returns>the projected point on this face</returns>
      static private Autodesk.Revit.DB.XYZ Project(List<XYZ> xyzArray, Autodesk.Revit.DB.XYZ point)
      {
         Autodesk.Revit.DB.XYZ a = xyzArray[0] - xyzArray[1];
         Autodesk.Revit.DB.XYZ b = xyzArray[0] - xyzArray[2];
         Autodesk.Revit.DB.XYZ c = point - xyzArray[0];

         Autodesk.Revit.DB.XYZ normal = (a.CrossProduct(b));

         try
         {
            normal = normal.Normalize();
         }
         catch (Exception)
         {
            normal = Autodesk.Revit.DB.XYZ.Zero;
         }

         Autodesk.Revit.DB.XYZ retProjectedPoint = point - (normal.DotProduct(c)) * normal;
         return retProjectedPoint;
      }
      #endregion

   }
}

PointUserControl.cs

//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//


namespace Revit.SDK.Samples.PlaceFamilyInstanceByFace.CS
{
    /// <summary>
    /// Stand for the point data of this user control
    /// </summary>
    partial class PointUserControl
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.secondBracketLabel = new System.Windows.Forms.Label();
            this.secondCommaLabel = new System.Windows.Forms.Label();
            this.firstCommaLabel = new System.Windows.Forms.Label();
            this.zCoordinateTextBox = new System.Windows.Forms.TextBox();
            this.yCoordinateTextBox = new System.Windows.Forms.TextBox();
            this.xCoordinateTextBox = new System.Windows.Forms.TextBox();
            this.firstBracketLabel = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // secondBracketLabel
            // 
            this.secondBracketLabel.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
            this.secondBracketLabel.AutoSize = true;
            this.secondBracketLabel.Location = new System.Drawing.Point(203, 4);
            this.secondBracketLabel.Name = "secondBracketLabel";
            this.secondBracketLabel.Size = new System.Drawing.Size(10, 13);
            this.secondBracketLabel.TabIndex = 7;
            this.secondBracketLabel.Text = ")";
            // 
            // secondCommaLabel
            // 
            this.secondCommaLabel.AutoSize = true;
            this.secondCommaLabel.Location = new System.Drawing.Point(134, 7);
            this.secondCommaLabel.Name = "secondCommaLabel";
            this.secondCommaLabel.Size = new System.Drawing.Size(10, 13);
            this.secondCommaLabel.TabIndex = 5;
            this.secondCommaLabel.Text = ",";
            // 
            // firstCommaLabel
            // 
            this.firstCommaLabel.AutoSize = true;
            this.firstCommaLabel.Location = new System.Drawing.Point(66, 8);
            this.firstCommaLabel.Name = "firstCommaLabel";
            this.firstCommaLabel.Size = new System.Drawing.Size(10, 13);
            this.firstCommaLabel.TabIndex = 3;
            this.firstCommaLabel.Text = ",";
            // 
            // zCoordinateTextBox
            // 
            this.zCoordinateTextBox.Location = new System.Drawing.Point(152, 1);
            this.zCoordinateTextBox.Name = "zCoordinateTextBox";
            this.zCoordinateTextBox.Size = new System.Drawing.Size(45, 20);
            this.zCoordinateTextBox.TabIndex = 6;
            this.zCoordinateTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.CoordinateTextBox_Validating);
            // 
            // yCoordinateTextBox
            // 
            this.yCoordinateTextBox.Location = new System.Drawing.Point(84, 1);
            this.yCoordinateTextBox.Name = "yCoordinateTextBox";
            this.yCoordinateTextBox.Size = new System.Drawing.Size(45, 20);
            this.yCoordinateTextBox.TabIndex = 4;
            this.yCoordinateTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.CoordinateTextBox_Validating);
            // 
            // xCoordinateTextBox
            // 
            this.xCoordinateTextBox.Location = new System.Drawing.Point(17, 1);
            this.xCoordinateTextBox.Name = "xCoordinateTextBox";
            this.xCoordinateTextBox.Size = new System.Drawing.Size(45, 20);
            this.xCoordinateTextBox.TabIndex = 2;
            this.xCoordinateTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.CoordinateTextBox_Validating);
            // 
            // firstBracketLabel
            // 
            this.firstBracketLabel.AutoSize = true;
            this.firstBracketLabel.Location = new System.Drawing.Point(-1, 2);
            this.firstBracketLabel.Name = "firstBracketLabel";
            this.firstBracketLabel.Size = new System.Drawing.Size(10, 13);
            this.firstBracketLabel.TabIndex = 1;
            this.firstBracketLabel.Text = "(";
            // 
            // PointUserControl
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.secondBracketLabel);
            this.Controls.Add(this.secondCommaLabel);
            this.Controls.Add(this.firstCommaLabel);
            this.Controls.Add(this.zCoordinateTextBox);
            this.Controls.Add(this.yCoordinateTextBox);
            this.Controls.Add(this.xCoordinateTextBox);
            this.Controls.Add(this.firstBracketLabel);
            this.Name = "PointUserControl";
            this.Size = new System.Drawing.Size(213, 24);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label secondBracketLabel;
        private System.Windows.Forms.Label secondCommaLabel;
        private System.Windows.Forms.Label firstCommaLabel;
        private System.Windows.Forms.TextBox zCoordinateTextBox;
        private System.Windows.Forms.TextBox yCoordinateTextBox;
        private System.Windows.Forms.TextBox xCoordinateTextBox;
        private System.Windows.Forms.Label firstBracketLabel;
    }
}

BasedType.cs

namespace Revit.SDK.Samples.PlaceFamilyInstanceByFace.CS
{
    partial class BasedTypeForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.buttonNext = new System.Windows.Forms.Button();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.radioButtonPoint = new System.Windows.Forms.RadioButton();
            this.radioButtonLine = new System.Windows.Forms.RadioButton();
            this.SuspendLayout();
            // 
            // buttonNext
            // 
            this.buttonNext.Location = new System.Drawing.Point(25, 50);
            this.buttonNext.Name = "buttonNext";
            this.buttonNext.Size = new System.Drawing.Size(75, 23);
            this.buttonNext.TabIndex = 1;
            this.buttonNext.Text = "&Next";
            this.buttonNext.UseVisualStyleBackColor = true;
            this.buttonNext.Click += new System.EventHandler(this.buttonNext_Click);
            // 
            // buttonCancel
            // 
            this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.buttonCancel.Location = new System.Drawing.Point(111, 50);
            this.buttonCancel.Name = "buttonCancel";
            this.buttonCancel.Size = new System.Drawing.Size(75, 23);
            this.buttonCancel.TabIndex = 2;
            this.buttonCancel.Text = "&Cancel";
            this.buttonCancel.UseVisualStyleBackColor = true;
            this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
            // 
            // radioButtonPoint
            // 
            this.radioButtonPoint.AutoSize = true;
            this.radioButtonPoint.Checked = true;
            this.radioButtonPoint.Location = new System.Drawing.Point(13, 12);
            this.radioButtonPoint.Name = "radioButtonPoint";
            this.radioButtonPoint.Size = new System.Drawing.Size(82, 17);
            this.radioButtonPoint.TabIndex = 0;
            this.radioButtonPoint.TabStop = true;
            this.radioButtonPoint.Text = "Point Based";
            this.radioButtonPoint.UseVisualStyleBackColor = true;
            // 
            // radioButtonLine
            // 
            this.radioButtonLine.AutoSize = true;
            this.radioButtonLine.Location = new System.Drawing.Point(119, 12);
            this.radioButtonLine.Name = "radioButtonLine";
            this.radioButtonLine.Size = new System.Drawing.Size(78, 17);
            this.radioButtonLine.TabIndex = 1;
            this.radioButtonLine.TabStop = true;
            this.radioButtonLine.Text = "Line Based";
            this.radioButtonLine.UseVisualStyleBackColor = true;
            // 
            // BasedTypeForm
            // 
            this.AcceptButton = this.buttonNext;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.buttonCancel;
            this.ClientSize = new System.Drawing.Size(219, 85);
            this.Controls.Add(this.radioButtonLine);
            this.Controls.Add(this.buttonCancel);
            this.Controls.Add(this.radioButtonPoint);
            this.Controls.Add(this.buttonNext);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "BasedTypeForm";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Based Type";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button buttonNext;
        private System.Windows.Forms.Button buttonCancel;
        private System.Windows.Forms.RadioButton radioButtonPoint;
        private System.Windows.Forms.RadioButton radioButtonLine;
    }
}

PlaceFamilyInstanceForm.cs

//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

namespace Revit.SDK.Samples.PlaceFamilyInstanceByFace.CS
{
    partial class PlaceFamilyInstanceForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.buttonCreate = new System.Windows.Forms.Button();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.comboBoxFace = new System.Windows.Forms.ComboBox();
            this.labelFace = new System.Windows.Forms.Label();
            this.labelFamilySymbol = new System.Windows.Forms.Label();
            this.comboBoxFamily = new System.Windows.Forms.ComboBox();
            this.labelSecond = new System.Windows.Forms.Label();
            this.labelFirst = new System.Windows.Forms.Label();
            this.PointControlSecond = new Revit.SDK.Samples.PlaceFamilyInstanceByFace.CS.PointUserControl();
            this.PointControlFirst = new Revit.SDK.Samples.PlaceFamilyInstanceByFace.CS.PointUserControl();
            this.SuspendLayout();
            // 
            // buttonCreate
            // 
            this.buttonCreate.Location = new System.Drawing.Point(144, 159);
            this.buttonCreate.Name = "buttonCreate";
            this.buttonCreate.Size = new System.Drawing.Size(73, 23);
            this.buttonCreate.TabIndex = 0;
            this.buttonCreate.Text = "Crea&te";
            this.buttonCreate.UseVisualStyleBackColor = true;
            this.buttonCreate.Click += new System.EventHandler(this.buttonCreate_Click);
            // 
            // buttonCancel
            // 
            this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.buttonCancel.Location = new System.Drawing.Point(233, 159);
            this.buttonCancel.Name = "buttonCancel";
            this.buttonCancel.Size = new System.Drawing.Size(73, 23);
            this.buttonCancel.TabIndex = 16;
            this.buttonCancel.Text = "&Cancel";
            this.buttonCancel.UseVisualStyleBackColor = true;
            // 
            // comboBoxFace
            // 
            this.comboBoxFace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxFace.FormattingEnabled = true;
            this.comboBoxFace.Location = new System.Drawing.Point(92, 14);
            this.comboBoxFace.Name = "comboBoxFace";
            this.comboBoxFace.Size = new System.Drawing.Size(214, 21);
            this.comboBoxFace.TabIndex = 7;
            this.comboBoxFace.SelectedIndexChanged += new System.EventHandler(this.comboBoxFace_SelectedIndexChanged);
            // 
            // labelFace
            // 
            this.labelFace.AutoSize = true;
            this.labelFace.Location = new System.Drawing.Point(9, 17);
            this.labelFace.Name = "labelFace";
            this.labelFace.Size = new System.Drawing.Size(37, 13);
            this.labelFace.TabIndex = 24;
            this.labelFace.Text = "Face :";
            // 
            // labelFamilySymbol
            // 
            this.labelFamilySymbol.AutoSize = true;
            this.labelFamilySymbol.Location = new System.Drawing.Point(9, 49);
            this.labelFamilySymbol.Name = "labelFamilySymbol";
            this.labelFamilySymbol.Size = new System.Drawing.Size(82, 13);
            this.labelFamilySymbol.TabIndex = 25;
            this.labelFamilySymbol.Text = "Family Symbol  :";
            // 
            // comboBoxFamily
            // 
            this.comboBoxFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxFamily.FormattingEnabled = true;
            this.comboBoxFamily.Location = new System.Drawing.Point(92, 46);
            this.comboBoxFamily.MaxDropDownItems = 9;
            this.comboBoxFamily.Name = "comboBoxFamily";
            this.comboBoxFamily.Size = new System.Drawing.Size(214, 21);
            this.comboBoxFamily.TabIndex = 26;
            // 
            // labelSecond
            // 
            this.labelSecond.AutoSize = true;
            this.labelSecond.Location = new System.Drawing.Point(9, 115);
            this.labelSecond.Name = "labelSecond";
            this.labelSecond.Size = new System.Drawing.Size(62, 13);
            this.labelSecond.TabIndex = 30;
            this.labelSecond.Text = "End Point  :";
            // 
            // labelFirst
            // 
            this.labelFirst.AutoSize = true;
            this.labelFirst.Location = new System.Drawing.Point(9, 83);
            this.labelFirst.Name = "labelFirst";
            this.labelFirst.Size = new System.Drawing.Size(65, 13);
            this.labelFirst.TabIndex = 29;
            this.labelFirst.Text = "Start Point  :";
            // 
            // PointControlSecond
            // 
            this.PointControlSecond.AutoSize = true;
            this.PointControlSecond.Location = new System.Drawing.Point(90, 112);
            this.PointControlSecond.Name = "PointControlSecond";
            this.PointControlSecond.Size = new System.Drawing.Size(216, 24);
            this.PointControlSecond.TabIndex = 28;
            // 
            // PointControlFirst
            // 
            this.PointControlFirst.AutoSize = true;
            this.PointControlFirst.Location = new System.Drawing.Point(90, 79);
            this.PointControlFirst.Name = "PointControlFirst";
            this.PointControlFirst.Size = new System.Drawing.Size(216, 24);
            this.PointControlFirst.TabIndex = 27;
            // 
            // PlaceFamilyInstanceForm
            // 
            this.AcceptButton = this.buttonCreate;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.buttonCancel;
            this.ClientSize = new System.Drawing.Size(319, 193);
            this.Controls.Add(this.PointControlSecond);
            this.Controls.Add(this.PointControlFirst);
            this.Controls.Add(this.labelSecond);
            this.Controls.Add(this.labelFirst);
            this.Controls.Add(this.comboBoxFamily);
            this.Controls.Add(this.labelFamilySymbol);
            this.Controls.Add(this.labelFace);
            this.Controls.Add(this.comboBoxFace);
            this.Controls.Add(this.buttonCancel);
            this.Controls.Add(this.buttonCreate);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "PlaceFamilyInstanceForm";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Place Family Instance";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button buttonCreate;
        private System.Windows.Forms.Button buttonCancel;
        private System.Windows.Forms.ComboBox comboBoxFace;
        private System.Windows.Forms.Label labelFace;
        private System.Windows.Forms.Label labelFamilySymbol;
        private System.Windows.Forms.ComboBox comboBoxFamily;
        private PointUserControl PointControlSecond;
        private PointUserControl PointControlFirst;
        private System.Windows.Forms.Label labelSecond;
        private System.Windows.Forms.Label labelFirst;
    }
}