Skip to content

Commit

Permalink
fix(model): use python with revit
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonelloDN authored and mostaphaRoudsari committed May 23, 2023
1 parent c03987d commit 0420df9
Showing 1 changed file with 95 additions and 12 deletions.
107 changes: 95 additions & 12 deletions pollination/alias/inputs/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

"""Alias inputs that expect a HBJSON model file as the recipe input."""
hbjson_model_input = [
# grasshopper Alias
# RH GH Alias
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large.',
platform=['grasshopper', 'rhino', 'revit'],
platform=['grasshopper', 'rhino'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
Expand All @@ -21,20 +21,33 @@
function='HBModelToJSON'
)
]
),
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large.',
platform=['revit'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
function='model_to_json'
)
]
)
]


"""Alias inputs that expect a HBJSON model with sensor grids."""
hbjson_model_grid_input = [
# grasshopper Alias
# RH GH Alias
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large. Note that this '
'model should have sensor grids assigned to it.',
platform=['grasshopper', 'rhino', 'revit'],
platform=['grasshopper', 'rhino'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
Expand All @@ -45,19 +58,33 @@
function='HBModelToJSON'
)
]
),
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large. Note that this '
'model should have sensor grids assigned to it.',
platform=['revit'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
function='model_to_json_grid_check'
)
]
)
]


"""Alias inputs that expect a HBJSON model with sensor grids and rooms."""
hbjson_model_grid_room_input = [
# grasshopper Alias
# RH GH Alias
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. Note that this model must contain rooms and have sensor '
'grids assigned to it.',
platform=['grasshopper', 'rhino', 'revit'],
platform=['grasshopper', 'rhino'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
Expand All @@ -68,20 +95,33 @@
function='HBModelToJSON'
)
]
),
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. Note that this model must contain rooms and have sensor '
'grids assigned to it.',
platform=['revit'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
function='model_to_json_grid_room_check'
)
]
)
]


"""Alias inputs that expect a HBJSON model with Rooms."""
hbjson_model_room_input = [
# grasshopper Alias
# RH GH Alias
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large. Note that this '
'model should have Rooms assigned to it to be usable with this recipe.',
platform=['grasshopper', 'rhino', 'revit'],
platform=['grasshopper', 'rhino'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
Expand All @@ -92,21 +132,35 @@
function='HBModelToJSON'
)
]
),
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large. Note that this '
'model should have Rooms assigned to it to be usable with this recipe.',
platform=['revit'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
function='model_to_json_room_check'
)
]
)
]


"""Alias inputs that expect a HBJSON model with HVAC systems."""
hbjson_model_hvac_input = [
# grasshopper Alias
# RH GH Alias
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. Note that this model should represent a full building and '
'have Programs, ConstructionSets, and real HVAC systems (other than Ideal Air) '
'assigned to it. If the building has hot water loads, the building should also '
'have a SHW system assigned to it for the results to be meaningful.',
platform=['grasshopper', 'rhino', 'revit'],
platform=['grasshopper', 'rhino'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
Expand All @@ -117,20 +171,35 @@
function='HBModelToJSON'
)
]
),
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. Note that this model should represent a full building and '
'have Programs, ConstructionSets, and real HVAC systems (other than Ideal Air) '
'assigned to it. If the building has hot water loads, the building should also '
'have a SHW system assigned to it for the results to be meaningful.',
platform=['revit'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
function='model_to_json_hvac_check'
)
]
)
]


"""Alias inputs that expect a HBJSON model with views."""
hbjson_model_view_input = [
# grasshopper Alias
# RH GH Alias
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large. Note that this '
'model should have views assigned to it.',
platform=['grasshopper', 'rhino', 'revit'],
platform=['grasshopper', 'rhino'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
Expand All @@ -141,6 +210,20 @@
function='HBModelToJSON'
)
]
),
InputAlias.any(
name='model',
description='A Honeybee Model to simulate or the path to a HBJSON file '
'of a Model. This can also be the path to a HBpkl file, though this is only '
'recommended for cases where the model is extremely large. Note that this '
'model should have views assigned to it.',
platform=['revit'],
handler=[
IOAliasHandler(
language='python', module='pollination_handlers.inputs.model',
function='model_to_json_view_check'
)
]
)
]

Expand Down

0 comments on commit 0420df9

Please sign in to comment.