Class: Microstation::TagSet
- Inherits:
-
Object
- Object
- Microstation::TagSet
- Defined in:
- lib/microstation/tag_set.rb
Instance Attribute Summary collapse
-
#drawing ⇒ Object
readonly
Returns the value of attribute drawing.
-
#instances ⇒ Object
readonly
def find_instances_in_model(model) result = create_instances(model.scan_tags) instances = result result end.
-
#ole_obj ⇒ Object
readonly
Returns the value of attribute ole_obj.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](name) ⇒ Object
- #add_attribute(name, type, **options, &block) ⇒ Object
-
#add_instance(array) ⇒ Object
def definer @definer ||= Definer.new(self) end.
- #attribute_names ⇒ Object
- #attributes ⇒ Object
-
#close ⇒ Object
def all_tags_in_drawing Microstation.app.current_drawing.scan_tags end.
- #create_instance(id, elements, model) ⇒ Object
-
#initialize(drawing, ole) ⇒ TagSet
constructor
A new instance of TagSet.
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(drawing, ole) ⇒ TagSet
Returns a new instance of TagSet.
243 244 245 246 247 |
# File 'lib/microstation/tag_set.rb', line 243 def initialize(drawing, ole) @drawing = drawing @ole_obj = ole @instances = nil end |
Instance Attribute Details
#drawing ⇒ Object (readonly)
Returns the value of attribute drawing.
241 242 243 |
# File 'lib/microstation/tag_set.rb', line 241 def drawing @drawing end |
#instances ⇒ Object (readonly)
def find_instances_in_model(model)
result = create_instances(model.)
instances[model.name] = result
result
end
287 288 289 |
# File 'lib/microstation/tag_set.rb', line 287 def instances @instances end |
#ole_obj ⇒ Object (readonly)
Returns the value of attribute ole_obj.
241 242 243 |
# File 'lib/microstation/tag_set.rb', line 241 def ole_obj @ole_obj end |
Instance Method Details
#==(other) ⇒ Object
318 319 320 |
# File 'lib/microstation/tag_set.rb', line 318 def ==(other) @ole_obj == other.ole_obj end |
#[](name) ⇒ Object
330 331 332 |
# File 'lib/microstation/tag_set.rb', line 330 def [](name) definition[name] end |
#add_attribute(name, type, **options, &block) ⇒ Object
249 250 251 |
# File 'lib/microstation/tag_set.rb', line 249 def add_attribute(name, type, **, &block) ts = definition.add_attribute(name, type, **, &block) end |
#add_instance(array) ⇒ Object
def definer
@definer ||= Definer.new(self)
end
257 258 259 |
# File 'lib/microstation/tag_set.rb', line 257 def add_instance(array) @instances << TS::Instance.new(self, array) end |
#attribute_names ⇒ Object
322 323 324 |
# File 'lib/microstation/tag_set.rb', line 322 def attribute_names definition.attribute_names end |
#attributes ⇒ Object
326 327 328 |
# File 'lib/microstation/tag_set.rb', line 326 def attributes definition.attributes end |
#close ⇒ Object
def all_tags_in_drawing
Microstation.app.current_drawing.
end
306 307 308 |
# File 'lib/microstation/tag_set.rb', line 306 def close @ole_obj = nil end |
#create_instance(id, elements, model) ⇒ Object
261 262 263 264 265 266 267 268 |
# File 'lib/microstation/tag_set.rb', line 261 def create_instance(base_element_id, , model) return unless @instaces.nil? @instance = [] ti = TS::Instances.new(self, base_element_id, , model) @instances << ti ti end |
#name ⇒ Object
310 311 312 |
# File 'lib/microstation/tag_set.rb', line 310 def name @ole_obj.name end |
#to_s ⇒ Object
314 315 316 |
# File 'lib/microstation/tag_set.rb', line 314 def to_s "TagSet: #{name}" end |