FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
RevitDevTool/samples/FSharpDemo/FaceVisualization.fs at develop · trgiangv/RevitDevTool · GitHub
trgiangv
/
RevitDevTool
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
13
Code
Pull requests
0
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
RevitDevTool
/
samples
/
FSharpDemo
/
FaceVisualization.fs
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (33 loc) · 1.44 KB
Breadcrumbs
RevitDevTool
/
samples
/
FSharpDemo
/
FaceVisualization.fs
Copy path
File metadata and controls
39 lines (33 loc) · 1.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespac
e
FSharpDem
o
open
System.
Diagnostics
open
Autodesk.
Revit
.
Attributes
open
Autodesk.
Revit
.
DB
open
Autodesk.
Revit
.
UI
.
Selection
open
JetBrains.
Annotations
open
Nice3point.
Revit
.
Toolkit
.
External
[<Transaction
(
TransactionMode.Manual
)
>]
[<UsedImplicitly>]
type
FaceVisualization
()
=
inherit
ExternalCommand
()
override
this.Execute
()
=
try
let
faceRef
=
this.Application.ActiveUIDocument.Selection.PickObject
(
ObjectType.Face
,
"
Select Face
"
)
let
face
=
this.Application.ActiveUIDocument.Document.GetElement
(
faceRef
)
.GetGeometryObjectFromReference
(
faceRef
)
:?>
Face
Trace.Write
(
face
)
with
|
ex
->
Trace.TraceError
(
$
"
Error in FaceVisualization: {ex.Message}
"
)
[<Transaction
(
TransactionMode.Manual
)
>]
[<UsedImplicitly>]
type
FacesVisualization
()
=
inherit
ExternalCommand
()
override
this.Execute
()
=
try
let
faceRefs
=
this.Application.ActiveUIDocument.Selection.PickObjects
(
ObjectType.Face
,
"
Select Faces
"
)
let
faces
=
[
for
faceRef
in
faceRefs
do
match
this.Application.ActiveUIDocument.Document.GetElement
(
faceRef
)
.GetGeometryObjectFromReference
(
faceRef
)
with
|
:?
Face
as
face
->
yield
face
|
_
->
Trace.TraceWarning
(
$
"
Face not found for reference: {faceRef}
"
)
]
Trace.Write
(
faces
)
with
|
ex
->
Trace.TraceError
(
$
"
Error in FacesVisualization: {ex.Message}
"
)
Back
|
FazBrowse Home
|
New Git URL