Revision history [back]
That's a good question, as you point out we have native support to tag some objects. Space Types can be tagged with the standards building type and standards space type. Constructions have a number of tags including the intended surface type and construction type. One key tag we don't have that I would like eventually is the ability to tag internal loads. I'd like to know if a load is an elevator or a computer without having to rely on the name or infer it using complex logic. Similarly I'd like to know whether a light is task or general lighting, and what kind of technology it uses. Until we have this there are a few options.
- Not very pretty one thing we have done is to overload the name with information we want, so for example I could make a lighting definition named "Task|Fluor|Mag|2|30", in one measure. Then in another measure I can parse the name into an array by using name.split("|"). Of course you need to know what each section means. In this case it is "Use Type|Technology|Ballast|Bulbs per fixture|Watts per Bulb".
- A variation on this is that every model object in OpenStudio can have a comment. You can set information in the comment instead of the name. Code is shown below. If you don't start the string with an exclamation point and a space, OpenStudio will add that to the beginning of your string.
(code below)
my_object.setComment("anything you want")
puts my_object.comment # this will return "! anything you want"
my_object.setComment("#{my_object.comment}|more info")
puts my_object.comment # this will return "! anything you want|more info"
That's a good question, as you point out we have native support to tag some objects. Space Types can be tagged with the standards building type and standards space type. Constructions have a number of tags including the intended surface type and construction type. One key tag we don't have that I would like eventually is the ability to tag internal loads. I'd like to know if a load is an elevator or a computer without having to rely on the name or infer it using on some complex logic. Similarly I'd like to know whether a light is task or general lighting, and what kind of technology it uses. Until we have this there are a few options.
- Not very pretty but one
thing we have doneopen we have used is to overload the name with information we want, so for example I could make a lighting definition named "Task|Fluor|Mag|2|30", in one measure. Then in another measure I can parse the name into an array by using name.split("|"). Of course you need to know what each section means. In this case it is "Use Type|Technology|Ballast|Bulbs per fixture|Watts per Bulb". - A variation on this is that every model object in OpenStudio can have a comment. You can set information in the comment instead of the name. Code is shown below. If you don't start the string with an exclamation point and a space, OpenStudio will add that to the beginning of your string.
(code below)
my_object.setComment("anything you want")
puts my_object.comment # this will return "! anything you want"
my_object.setComment("#{my_object.comment}|more info")
puts my_object.comment # this will return "! anything you want|more info"
That's a good question, as you point out we have native support to tag some objects. Space Types can be tagged with the standards building type and standards space type. Constructions have a number of tags including the intended surface type and construction type. One key tag we don't have that I would like eventually is the ability to tag internal loads. I'd like to know if a load is an elevator or a computer without having to rely on the name or infer it on some complex logic. Similarly I'd like to know whether a light is task or general lighting, and what kind of technology it uses. Until we have this there are a few options.
- Not very pretty but one open we have used is to overload the name with information we want, so for example I could make a lighting definition named "Task|Fluor|Mag|2|30", in one measure. Then in another measure I can parse the name into an array by using name.split("|"). Of course you need to know what each section means. In this case it is "Use Type|Technology|Ballast|Bulbs per fixture|Watts per Bulb".
- A variation on this is that every model object in OpenStudio can have a comment. You can set information in the comment instead of the name. Code is shown below. If you don't start the string with an exclamation point and a space, OpenStudio will add that to the beginning of your string.
(code below)
my_object.setComment("anything you want")
puts my_object.comment # this will return "! anything you want"
want")
my_object.setComment("#{my_object.comment}|more info")
puts my_object.comment # this will return "! anything you want|more info"
That's a good question, as you point out we have native support to tag some objects. Space Types can be tagged with the standards building type and standards space type. Constructions have a number of tags including the intended surface type and construction type. One key tag we don't have that I would like eventually is the ability to tag internal loads. I'd like to know if a load is an elevator or a computer without having to rely on the name or infer it on some complex logic. Similarly I'd like to know whether a light is task or general lighting, and what kind of technology it uses. Until we have this there are a few options.
- Not very pretty but one open we have used is to overload the name with information we want, so for example I could make a lighting definition named "Task|Fluor|Mag|2|30", in one measure. Then in another measure I can parse the name into an array by using name.split("|"). Of course you need to know what each section means. In this case it is "Use Type|Technology|Ballast|Bulbs per fixture|Watts per Bulb".
- A variation on this is that every model object in OpenStudio can have a comment. You can set information in the comment instead of the name. Code is shown below. If you don't start the string with an exclamation point and a space, OpenStudio will add that to the beginning of your string.
(code below)
my_object.setComment("anything you want")
puts my_object.comment # this will return "! anything you want")
my_object.setComment("#{my_object.comment}|more info")
puts my_object.comment # this will return "! anything you want|more info"
info"