|
7 | 7 | __author__ = 'Adam Bear - adam@ukbear.com' |
8 | 8 | __twitter__ = '@adambear82' |
9 | 9 | __github__ = '@adambear82' |
10 | | -__version__ = '1.0.0' |
| 10 | +__version__ = '1.0.1' |
11 | 11 |
|
12 | 12 | ''' |
13 | 13 | for large projects with lots of room data it is useful to analyse in |
|
46 | 46 | FilterDoubleRule, FilterNumericGreater, LogicalAndFilter, \ |
47 | 47 | ModelPathUtils, ParameterValueProvider, SpatialElement, \ |
48 | 48 | SpatialElementBoundaryOptions, SpatialElementBoundaryLocation |
| 49 | +# to create svg of areas instead of rooms import the room filter |
| 50 | +# so that rooms can be filtered instead of areas |
| 51 | +from Autodesk.Revit.DB.Architecture import RoomFilter |
49 | 52 |
|
50 | 53 | # add reference for RevitServices (RevitServices) |
51 | 54 | clr.AddReference('RevitServices') |
@@ -195,6 +198,8 @@ def ListChopUnevenly(chopList, chopLengths) : |
195 | 198 |
|
196 | 199 | # alias areaFilter, for areas (not rooms) we will want to exclude |
197 | 200 | areaFilter = AreaFilter() |
| 201 | +# change to room filter if you want svg of areas not rooms |
| 202 | +#areaFilter = RoomFilter() |
198 | 203 | # collect elements to be excluded |
199 | 204 | areaExcludes = fec(doc).WherePasses(areaFilter).ToElements() |
200 | 205 | # convert to a list if not allready so |
@@ -422,20 +427,23 @@ def ListChopUnevenly(chopList, chopLengths) : |
422 | 427 |
|
423 | 428 | # min x value from nested sublist extracted using consecutive min() |
424 | 429 | xmin = min(min(x)) |
425 | | -# min x value rounded up for use in svg tag |
426 | | -xminc = math.ceil(xmin) |
| 430 | +# min x value rounded up/down for +/-ve numbers for use in svg tag |
| 431 | +if xmin < 0 : xminc = math.floor(xmin) |
| 432 | +else : xminc = math.ceil(xmin) |
427 | 433 | # max x value from nested sublist extracted using consecutive max() |
428 | 434 | xmax = max(max(x)) |
429 | 435 | # width of svg viewbox rounded up from, max - min |
430 | | -width = math.ceil(xmax - xmin) |
| 436 | +width = math.ceil(xmax - xminc) |
431 | 437 | # min y value from nested sublist extracted using consecutive min() |
432 | 438 | ymin = min(min(y)) |
433 | | -# min y value rounded up for use in svg tag |
434 | | -yminc = math.ceil(ymin) |
| 439 | +# min y value rounded up/down for +/-ve numbers for use in svg tag |
| 440 | +if ymin < 0 : yminc = math.floor(ymin) |
| 441 | +else : yminc = math.ceil(ymin) |
| 442 | +#yminc = math.ceil(ymin) |
435 | 443 | # max y value from nested sublist extracted using consecutive max() |
436 | 444 | ymax = max(max(y)) |
437 | 445 | # height of svg viewbox rounded up from, max - min |
438 | | -height = math.ceil(ymax - ymin) |
| 446 | +height = math.ceil(ymax - yminc) |
439 | 447 | # create a list of values |
440 | 448 | svg = svgStart, xminc, yminc, width, height, svgTransform, svgScale, \ |
441 | 449 | svgEnd |
|
0 commit comments