Class: Microstation::TagSet
- Inherits:
-
Object
- Object
- Microstation::TagSet
- Defined in:
- lib/microstation/tag_set.rb
Instance Attribute Summary collapse
-
#ole_obj ⇒ Object
readonly
Returns the value of attribute ole_obj.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](name) ⇒ Object
- #add_attribute(name, type, options = {}) ⇒ Object
- #add_instance(array) ⇒ Object
- #all_tags_in_drawing ⇒ Object
- #attribute_names ⇒ Object
- #attributes ⇒ Object
- #close ⇒ Object
- #create_instance(group) ⇒ Object
- #create_instances(tags) ⇒ Object
- #definer ⇒ Object
- #definition ⇒ Object
- #grouped_tags_to_host(tags) ⇒ Object
-
#initialize(ole) ⇒ TagSet
constructor
A new instance of TagSet.
- #instances(drawing = Microstation.app.current_drawing) ⇒ Object
- #name ⇒ Object
- #ole_tag_definitions ⇒ Object
-
#reset ⇒ Object
def ole_tag_definitions @tag_definitions = @ole_obj.TagDefinitions end.
- #tags_for_self(tags) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(ole) ⇒ TagSet
Returns a new instance of TagSet.
181 182 183 184 |
# File 'lib/microstation/tag_set.rb', line 181 def initialize(ole) @ole_obj = ole @instances = [] end |
Instance Attribute Details
#ole_obj ⇒ Object (readonly)
Returns the value of attribute ole_obj.
179 180 181 |
# File 'lib/microstation/tag_set.rb', line 179 def ole_obj @ole_obj end |
Instance Method Details
#==(other) ⇒ Object
262 263 264 |
# File 'lib/microstation/tag_set.rb', line 262 def ==(other) @ole_obj == other.ole_obj end |
#[](name) ⇒ Object
274 275 276 |
# File 'lib/microstation/tag_set.rb', line 274 def [](name) definition[name] end |
#add_attribute(name, type, options = {}) ⇒ Object
191 192 193 |
# File 'lib/microstation/tag_set.rb', line 191 def add_attribute(name,type,={}) definition.add_attribute(name,type,) end |
#add_instance(array) ⇒ Object
213 214 215 |
# File 'lib/microstation/tag_set.rb', line 213 def add_instance(array) @instances << TS::Instance.new(self,array) end |
#all_tags_in_drawing ⇒ Object
240 241 242 |
# File 'lib/microstation/tag_set.rb', line 240 def Microstation.app.current_drawing. end |
#attribute_names ⇒ Object
266 267 268 |
# File 'lib/microstation/tag_set.rb', line 266 def attribute_names definition.attribute_names end |
#attributes ⇒ Object
270 271 272 |
# File 'lib/microstation/tag_set.rb', line 270 def attributes definition.attributes end |
#close ⇒ Object
249 250 251 |
# File 'lib/microstation/tag_set.rb', line 249 def close @ole_obj = nil end |
#create_instance(group) ⇒ Object
217 218 219 |
# File 'lib/microstation/tag_set.rb', line 217 def create_instance(group) TS::Instance.new(self,group) end |
#create_instances(tags) ⇒ Object
225 226 227 228 229 |
# File 'lib/microstation/tag_set.rb', line 225 def create_instances() = () grouped = () grouped.map{|group| create_instance(group)} end |
#definer ⇒ Object
195 196 197 |
# File 'lib/microstation/tag_set.rb', line 195 def definer @definer ||= Definer.new(self) end |
#definition ⇒ Object
245 246 247 |
# File 'lib/microstation/tag_set.rb', line 245 def definition @definition ||= Definition.new(self) end |
#grouped_tags_to_host(tags) ⇒ Object
235 236 237 |
# File 'lib/microstation/tag_set.rb', line 235 def () .group_by{|t| t.base_element_id}.values end |
#instances(drawing = Microstation.app.current_drawing) ⇒ Object
186 187 188 |
# File 'lib/microstation/tag_set.rb', line 186 def instances Microstation.app.current_drawing.(self.name) end |
#name ⇒ Object
254 255 256 |
# File 'lib/microstation/tag_set.rb', line 254 def name @ole_obj.name end |
#ole_tag_definitions ⇒ Object
199 200 201 |
# File 'lib/microstation/tag_set.rb', line 199 def ole_tag_definitions @ole_obj.TagDefinitions end |
#reset ⇒ Object
def ole_tag_definitions
@tag_definitions = @ole_obj.TagDefinitions
end
209 210 211 |
# File 'lib/microstation/tag_set.rb', line 209 def reset @tag_definitions = nil end |
#tags_for_self(tags) ⇒ Object
231 232 233 |
# File 'lib/microstation/tag_set.rb', line 231 def () .select{|t| t. == name} end |
#to_s ⇒ Object
258 259 260 |
# File 'lib/microstation/tag_set.rb', line 258 def to_s "TagSet: #{name}" end |