Created
June 27, 2020 03:51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace FsharpDemo | |
open Autodesk.Revit.Attributes | |
open Autodesk.Revit.UI | |
open Autodesk.Revit.DB | |
[<TransactionAttribute(TransactionMode.Manual)>] | |
type SelectedElement() = | |
interface IExternalCommand with | |
member this.Execute(cdata:ExternalCommandData, msg, elset) = | |
let uiapp = cdata.Application | |
let uidoc = uiapp.ActiveUIDocument | |
let selected = | |
uidoc.Selection.GetElementIds() |> Seq.cast | |
|> Seq.map (fun(eid:ElementId) -> uidoc.Document.GetElement(eid)) | |
let msg = | |
selected | |
|> Seq.map (fun(e:Element) -> e.Name) | |
|> String.concat "\n" | |
TaskDialog.Show("Title", msg) |> ignore | |
Result.Succeeded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment