FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
RevitDevTool/samples/FSharpDemo/CurveVisualization.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
/
CurveVisualization.fs
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (33 loc) · 1.4 KB
Breadcrumbs
RevitDevTool
/
samples
/
FSharpDemo
/
CurveVisualization.fs
Copy path
File metadata and controls
39 lines (33 loc) · 1.4 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
CurveVisualization
()
=
inherit
ExternalCommand
()
override
this.Execute
()
=
try
let
curveRef
=
this.Application.ActiveUIDocument.Selection.PickObject
(
ObjectType.Edge
,
"
Select Curve
"
)
let
curve
=
this.Application.ActiveUIDocument.Document.GetElement
(
curveRef
)
.GetGeometryObjectFromReference
(
curveRef
)
:?>
Edge
Trace.Write
(
curve
)
with
|
ex
->
Trace.TraceError
(
$
"
Error in CurveVisualization: {ex.Message}
"
)
[<Transaction
(
TransactionMode.Manual
)
>]
[<UsedImplicitly>]
type
CurvesVisualization
()
=
inherit
ExternalCommand
()
override
this.Execute
()
=
try
let
curveRefs
=
this.Application.ActiveUIDocument.Selection.PickObjects
(
ObjectType.Edge
,
"
Select Curves
"
)
let
curves
=
[
for
curveRef
in
curveRefs
do
match
this.Application.ActiveUIDocument.Document.GetElement
(
curveRef
)
.GetGeometryObjectFromReference
(
curveRef
)
with
|
:?
Edge
as
edge
->
yield
edge
|
_
->
()
]
Trace.Write
(
curves
)
with
|
ex
->
Trace.TraceError
(
$
"
Error in CurvesVisualization: {ex.Message}
"
)
Back
|
FazBrowse Home
|
New Git URL