/// <summary> /// Constructor /// </summary> /// <param name="creator">the family instance creator</param> /// <param name="type">based-type</param> public PlaceFamilyInstanceForm(FamilyInstanceCreator creator, BasedType type) { m_creator = creator; m_creator.CheckFamilySymbol(type); m_baseType = type; InitializeComponent(); // set the face name list and the default value foreach (String name in creator.FaceNameList) { comboBoxFace.Items.Add(name); } if (comboBoxFace.Items.Count > 0) { SetFaceIndex(0); } // set the family name list and the default value foreach (String symbolName in m_creator.FamilySymbolNameList) { comboBoxFamily.Items.Add(symbolName); } if (m_creator.DefaultFamilySymbolIndex < 0) { comboBoxFamily.SelectedItem = m_creator.FamilySymbolNameList[0]; } else { comboBoxFamily.SelectedItem = m_creator.FamilySymbolNameList[m_creator.DefaultFamilySymbolIndex]; } // set UI display according to baseType switch (m_baseType) { case BasedType.Point: this.Text = "Place Point-Based Family Instance"; labelFirst.Text = "Location :"; labelSecond.Text = "Direction :"; break; case BasedType.Line: comboBoxFamily.SelectedItem = "Line-based"; this.Text = "Place Line-Based Family Instance"; labelFirst.Text = "Start Point :"; labelSecond.Text = "End Point :"; break; default: break; } AdjustComboBoxDropDownListWidth(comboBoxFace); AdjustComboBoxDropDownListWidth(comboBoxFamily); }