Beispiel #1
0
        private void buttonSelect_Click(object sender, EventArgs e)
        {
            Document  doc        = CATIA.ActiveDocument;
            Selection lineSelect = doc.Selection;

            object[] selType = new object[3]
            {
                CATSelectionFilter.MonoDim.ToString(),
                     CATSelectionFilter.MonoDimInfinite.ToString(),
                     CATSelectionFilter.BiDim.ToString()
            };

            string status = lineSelect.SelectElement2(selType, "Select element", false);

            if (status == "cancel")
            {
                return;
            }


            _selection = lineSelect;
            _objLine   = lineSelect.Item2(1).Value;
            _objRef    = lineSelect.Item2(1).Reference;

            textBoxSelect.Text = lineSelect.Item2(1).Reference.DisplayName;

            //lineSelect.Clear();
        }
Beispiel #2
0
 public static Parameter AsParameter(this CATBaseDispatch i)
 {
     return((Parameter)i);
 }
Beispiel #3
0
 public static PartDocument AsPartDocument(this CATBaseDispatch i)
 {
     return((PartDocument)i);
 }
Beispiel #4
0
 public static Document AsDocument(this CATBaseDispatch i)
 {
     return((Document)i);
 }