コード例 #1
0
ファイル: App.cs プロジェクト: xin1627/RevitSdkSamples
        //--------------------------------------------------------------
        #endregion

        #region event handlers
        //--------------------------------------------------------------

        private void On_ElementSelected(object sender, MainWindow.ElementSelectedEventArgs e)
        {
            UIDocument uiDoc = commandData.Application.ActiveUIDocument;

            uiDoc.Selection.Elements.Clear();
            uiDoc.Selection.Elements.Add(e.SelectedElement);
            uiDoc.RefreshActiveView();
        }
コード例 #2
0
        //--------------------------------------------------------------
        #endregion

        #region event handlers
        //--------------------------------------------------------------

        private void On_ElementSelected(object sender, MainWindow.ElementSelectedEventArgs e)
        {
            UIDocument uiDoc = commandData.Application.ActiveUIDocument;

            uiDoc.Selection.GetElementIds().Clear();
            List <ElementId> elIds = new List <ElementId>();

            elIds.Add(e.SelectedElement.Id);
            uiDoc.Selection.SetElementIds(elIds);

            uiDoc.RefreshActiveView();
        }