dc3dserver
DirectContext3DServer wrapper and utilities.
Attributes
Edge = namedtuple('Edge', ['a', 'b', 'color'])
module-attribute
Triangle = namedtuple('Triangle', ['a', 'b', 'c', 'normal', 'color'])
module-attribute
Classes
Mesh(edges, triangles)
Bases: object
Geometry container class to generate DirectContext3DServer buffers.
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
Attributes
edges = edges
instance-attribute
triangles = triangles
instance-attribute
vertices = vertices
instance-attribute
Functions
calculate_triangle_normal(a, b, c)
staticmethod
from_solid(doc, solid)
classmethod
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
from_boundingbox(bounding_box, color, black_edges=True)
classmethod
Generates a Mesh object from the input BoundigBoxXYZ.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bounding_box |
BoundingBoxXYZ
|
The source object. |
required |
color |
ColorWithTransparency
|
The desired color. |
required |
black_edges |
bool
|
To have black edges instead of the provided color. Defaults to True. |
True
|
Returns:
Type | Description |
---|---|
Mesh
|
The resulting Mesh |
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
Buffer(display_style, vertex_buffer, vertex_count, index_buffer, index_count, vertex_format, effect_instance, primitive_type, start, primitive_count)
Bases: object
Buffer container for DirectContext3DServer.
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
Attributes
display_style = display_style
instance-attribute
vertex_buffer = vertex_buffer
instance-attribute
vertex_count = vertex_count
instance-attribute
index_buffer = index_buffer
instance-attribute
index_count = index_count
instance-attribute
vertex_format = vertex_format
instance-attribute
effect_instance = effect_instance
instance-attribute
primitive_type = primitive_type
instance-attribute
start = start
instance-attribute
primitive_count = primitive_count
instance-attribute
Functions
is_valid(display_style)
build_edge_buffer(display_style, meshes)
classmethod
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
build_triangle_buffer(display_style, meshes, transparent=False)
classmethod
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
|
flush()
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
Server(guid=None, uidoc=None, name='pyRevit DirectContext3DServer', description='Displaying temporary geometries', vendor_id='pyRevit', register=True)
Bases: IDirectContext3DServer
A generic DirectContext3dServer interface implementation.
Initalize a DirectContext3DServer instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
guid |
Guid
|
The guid of the server, auto-generated if None. Defaults to None. |
None
|
uidoc |
UIDocument
|
Required only, if the geometry is Document specific. Defaults to None. |
None
|
name |
str
|
The name of the server. Defaults to "pyRevit DirectContext3DServer". |
'pyRevit DirectContext3DServer'
|
description |
str
|
The descritpion of the server. Defaults to "Displaying temporary geometries". |
'Displaying temporary geometries'
|
vendor_id |
str
|
The name of the vendor. Defaults to "pyRevit". |
'pyRevit'
|
register |
bool
|
To register the server on initalization. Defaults to True. |
True
|
Source code in pyrevitlib/pyrevit/revit/dc3dserver.py
Attributes
guid = Guid.NewGuid()
instance-attribute
uidoc = uidoc
instance-attribute
name = name
instance-attribute
description = description
instance-attribute
vendor_id = vendor_id
instance-attribute
enabled_view_types = [DB.ViewType.ThreeD, DB.ViewType.Elevation, DB.ViewType.Section, DB.ViewType.FloorPlan, DB.ViewType.CeilingPlan, DB.ViewType.EngineeringPlan]
instance-attribute
meshes
property
writable
The container for the source geometries.