FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
RevitDevTool/samples/CSharpDemo/MeshVisualization.cs 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
/
CSharpDemo
/
MeshVisualization.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (42 loc) · 1.32 KB
Breadcrumbs
RevitDevTool
/
samples
/
CSharpDemo
/
MeshVisualization.cs
Copy path
File metadata and controls
45 lines (42 loc) · 1.32 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
39
40
41
42
43
44
45
using
Autodesk
.
Revit
.
Attributes
;
using
Autodesk
.
Revit
.
UI
.
Selection
;
using
Nice3point
.
Revit
.
Toolkit
.
External
;
using
CSharpDemo
.
Extensions
;
using
System
.
Diagnostics
;
namespace
CSharpDemo
;
[
Transaction
(
TransactionMode
.
Manual
)
]
[
UsedImplicitly
]
public
class
MeshVisualization
:
ExternalCommand
{
public
override
void
Execute
(
)
{
try
{
var
meshRef
=
Application
.
ActiveUIDocument
.
Selection
.
PickObject
(
ObjectType
.
Element
,
"Select Mesh Element"
)
;
var
mesh
=
Application
.
ActiveUIDocument
.
Document
.
GetElement
(
meshRef
)
.
GetMeshes
(
)
;
Trace
.
Write
(
mesh
.
First
(
)
)
;
}
catch
(
Exception
e
)
{
Trace
.
TraceError
(
$
"Error in MeshVisualization:
{
e
.
Message
}
"
)
;
}
}
}
[
Transaction
(
TransactionMode
.
Manual
)
]
[
UsedImplicitly
]
public
class
MeshesVisualization
:
ExternalCommand
{
public
override
void
Execute
(
)
{
try
{
var
meshRefs
=
Application
.
ActiveUIDocument
.
Selection
.
PickObjects
(
ObjectType
.
Element
,
"Select Mesh Elements"
)
;
var
meshes
=
meshRefs
.
SelectMany
(
mRef
=>
Application
.
ActiveUIDocument
.
Document
.
GetElement
(
mRef
)
.
GetMeshes
(
)
)
.
ToList
(
)
;
Trace
.
Write
(
meshes
)
;
}
catch
(
Exception
e
)
{
Trace
.
TraceError
(
$
"Error in MeshesVisualization:
{
e
.
Message
}
"
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL