Class: Microstation::Drawing
- Inherits:
-
Object
- Object
- Microstation::Drawing
- Includes:
- Properties, ScanTrait, TagSetTrait
- Defined in:
- lib/microstation/dir.rb,
lib/microstation/drawing.rb,
lib/microstation/extensions/faa.rb,
lib/microstation/extensions/faa.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Is the drawing active?.
- #active_model ⇒ Object
- #add_element(line) ⇒ Object
-
#basename ⇒ Pathname
The name as Pathname.
-
#cad_input_queue {|Microstation::CadInputQueue| ... } ⇒ Object
the block.
-
#change_model(name) ⇒ Model?
(also: #activate_model)
activate the model with name param name [String] name the name of the model activate the model found and return the model.
- #change_text_suffix(reg, offset) ⇒ Object
- #close ⇒ Object
-
#copy(name: nil, dir: nil) ⇒ Object
copy the drawing.
- #create_line(p1, p2, el = nil) ⇒ Object
- #create_scanner(name, &block) ⇒ Object
- #create_tagset_instance_from_tagset_hash(h) ⇒ Object
- #create_tagset_instances(ts_name: nil, base_element_id: nil) ⇒ Object
-
#create_tagset_instances_bak ⇒ Object
used.
-
#default_model_reference ⇒ Model
The ole.DefaultModelReference.
-
#dimensions ⇒ Object
alias_method :keywords , :keywords=x.
-
#dirname ⇒ Pathname
The directory of the file.
- #drawing_closed? ⇒ Boolean
-
#each_model {|Model| ... } ⇒ Object
iterate through each model in the drawing and yield them.
- #eval_cexpression(string) ⇒ Object
-
#find_by_id(id) ⇒ Object
Iterates through all the models and finds the ole_el with id.
- #find_line_element ⇒ Object
-
#find_model(name) ⇒ Model?
Find the model in the drawing.
- #find_tagset_instance_by_name(name) ⇒ Object
- #find_tagset_instance_by_name_and_id(name, id) ⇒ Object
- #find_tagset_instance_from_hash(ti_array, h_local) ⇒ Object
- #find_tagset_instances_called? ⇒ Boolean
- #find_tagsets ⇒ Object
- #get_matching_text(re, &block) ⇒ Object
- #get_selected_elements ⇒ Object
- #get_selected_text ⇒ Object
-
#get_tagsets_in_drawing_hash(ts_name: nil, base_element_id: nil) ⇒ Object
used.
- #get_text(&block) ⇒ Object
-
#has_active_model? ⇒ Boolean
True if drawing has an active model.
-
#initialize(app, ole) ⇒ Drawing
constructor
Initialize drawing.
-
#model_names ⇒ Array<String>
Returns the model names.
- #models ⇒ Object
-
#modified_date ⇒ Date
Date last modified.
-
#multiple_models? ⇒ Boolean
True if drawing has more than 1 model.
-
#name ⇒ String
The name of the drawing.
-
#new_model(name, template = nil) ⇒ Object
Create a new model.
- #number ⇒ Object
-
#ole_obj ⇒ WIN32OLE
returns the internal ole_obj.
-
#path ⇒ Pathname
The complete path of file.
- #pdf_driver ⇒ Object
- #pdf_name(name = nil) ⇒ Object
- #pen_table ⇒ Object
-
#read_only? ⇒ Boolean
Is the drawing readonly?.
- #reset_tagset_instances ⇒ Object
- #revision_count ⇒ Object
-
#save ⇒ void
Save the drawing.
-
#save_as(name, overwrite: false, format: 0) ⇒ void
Save the drawing under a different name.
-
#save_as_pdf(name: nil, dir: nil) ⇒ void
save the drawing as a pdf file if the name or directory is given it uses those params.
- #save_tagsets_to_file(name) ⇒ Object
-
#scan_all(criteria, &block) ⇒ Object
scans all the drawing models with criteria calls scan_all_with_block calls scal_all_with_hash.
-
#scan_cells {|Cell| ... } ⇒ Object
scan all cells in drawing and.
-
#scan_model(criteria, model: default_model_reference) { ... } ⇒ Object
Scan the drawing.
-
#scan_tags {|Tag| ... } ⇒ Object
scan all tags in drawing and.
-
#scan_text {|String| ... } ⇒ Object
scan all text and text regions in all models.
- #scan_text_in_cells(&block) ⇒ Object
- #select_tagset_instances_by_name(name) ⇒ Object
- #tagsets_in_drawing ⇒ Object
- #tagsets_in_drawing! ⇒ Object
-
#three_d? ⇒ Boolean
True if a 3d drawing.
- #to_ole_point3d(pt) ⇒ Object
- #to_point(pt) ⇒ Object
-
#two_d? ⇒ Boolean
True if a 2d drawing.
- #update_error ⇒ Object
- #update_tagset(name, h_local = {}) ⇒ Object
- #update_tagsets(ts_arg) ⇒ Object
- #update_tagsets_from_template_structure(ts_arg) ⇒ Object
- #wait_save_event(secs, interval = 0.5) ⇒ Object
- #zoom_to_element(target, n_view) ⇒ Object
Methods included from ScanTrait
#cells_criteria, #graphics_criteria, #lines_criteria, #scan, #scan_cell_with_name, #scan_graphical, #scan_lines, #tags_criteria, #text_criteria
Methods included from TagSetTrait
#create_tagset, #create_tagset!, #find_tagset, #remove_tagset, #reset_tagsets, #tagset_names, #tagsets
Methods included from Properties
#author=, #comments=, #keywords=, #subject=, #title=
Constructor Details
#initialize(app, ole) ⇒ Drawing
Initialize drawing
31 32 33 34 35 36 37 38 39 |
# File 'lib/microstation/drawing.rb', line 31 def initialize(app, ole) @app = app @ole_obj = ole @find_tagset_instances_called = false @app.register_handler('ISaveAsEvents_AfterSaveAs') do |*args| @drawing_saved = true end end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
23 24 25 |
# File 'lib/microstation/drawing.rb', line 23 def app @app end |
Instance Method Details
#active? ⇒ Boolean
Returns is the drawing active?.
50 51 52 |
# File 'lib/microstation/drawing.rb', line 50 def active? ole_obj.IsActive end |
#active_model ⇒ Object
202 203 204 205 |
# File 'lib/microstation/drawing.rb', line 202 def active_model return nil unless has_active_model? Model.new(app,self, app_ole_obj.ActiveModelReference) end |
#add_element(line) ⇒ Object
419 420 421 |
# File 'lib/microstation/drawing.rb', line 419 def add_element(line) active_model.add_element(line) end |
#basename ⇒ Pathname
Returns the name as Pathname.
243 244 245 |
# File 'lib/microstation/drawing.rb', line 243 def basename Pathname(name) end |
#cad_input_queue {|Microstation::CadInputQueue| ... } ⇒ Object
the block
56 57 58 |
# File 'lib/microstation/drawing.rb', line 56 def cad_input_queue(&block) @app.cad_input_queue(&block) end |
#change_model(name) ⇒ Model? Also known as: activate_model
activate the model with name param name [String] name the name of the model activate the model found and return the model
362 363 364 365 366 |
# File 'lib/microstation/drawing.rb', line 362 def change_model(name) model = find_model(name) return unless model model.activate end |
#change_text_suffix(reg, offset) ⇒ Object
354 355 356 |
# File 'lib/microstation/drawing.rb', line 354 def change_text_suffix(reg,offset) active_model.change_text_suffix(reg,offset) end |
#close ⇒ Object
265 266 267 268 269 |
# File 'lib/microstation/drawing.rb', line 265 def close @drawing_closed = true ole_obj.Close rescue nil @ole_obj =nil end |
#copy(name: nil, dir: nil) ⇒ Object
copy the drawing
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/microstation/drawing.rb', line 63 def copy(name: nil, dir: nil) if dir.nil? lname = name || copy_name dir_path = self.dirname else lname = name || self.name dir_path = Pathname(dir) end copy_path = dir_path + lname FileUtils.copy self.path.to_s, copy_path.to_s, verbose: true end |
#create_line(p1, p2, el = nil) ⇒ Object
597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/microstation/drawing.rb', line 597 def create_line(p1,p2,el = nil) # el = find_line_element pt1,pt2 = [p1,p2].map{ |p| to_ole_point3d(p) } el = WIN32OLE_VARIANT::Nothing unless el el = el.ole_obj if el.respond_to? :ole_obj begin ole = app.ole_obj.CreateLineElement2(el, pt1,pt2) return nil unless ole app.wrap(ole) rescue Exception => ex puts ex. bb puts "class: #{el.class}" return nil end end |
#create_scanner(name, &block) ⇒ Object
423 424 425 |
# File 'lib/microstation/drawing.rb', line 423 def create_scanner(name,&block) app.create_scanner(name,&block) end |
#create_tagset_instance_from_tagset_hash(h) ⇒ Object
462 463 464 465 |
# File 'lib/microstation/drawing.rb', line 462 def (h) ts = [h[:name]] ts.create_instance( h[:base_element_id], h[:tags], h[:model]) end |
#create_tagset_instances(ts_name: nil, base_element_id: nil) ⇒ Object
444 445 446 447 448 449 450 451 |
# File 'lib/microstation/drawing.rb', line 444 def (ts_name: nil, base_element_id: nil) result = [] @find_tagset_instances_called = true (ts_name: ts_name, base_element_id: base_element_id) do |h| result << (h) end result end |
#create_tagset_instances_bak ⇒ Object
used
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/microstation/drawing.rb', line 428 def () result = [] @find_tagset_instances_called = true filtered = if block_given? .select(&filter) else end binding.pry filtered.map do |h| element_id = h[:base_element_id] result << .create_instance(element_id, h[:tags], h[model]) end result end |
#default_model_reference ⇒ Model
Returns the ole.DefaultModelReference.
197 198 199 |
# File 'lib/microstation/drawing.rb', line 197 def default_model_reference Model.new(app,self,ole_obj.DefaultModelReference) end |
#dimensions ⇒ Object
alias_method :keywords , :keywords=x
219 220 221 |
# File 'lib/microstation/drawing.rb', line 219 def dimensions eval_cexpression("tcb->ndices") end |
#dirname ⇒ Pathname
Returns the directory of the file.
248 249 250 |
# File 'lib/microstation/drawing.rb', line 248 def dirname Pathname(ole_obj.Path). end |
#drawing_closed? ⇒ Boolean
271 272 273 |
# File 'lib/microstation/drawing.rb', line 271 def drawing_closed? @drawing_closed end |
#each_model {|Model| ... } ⇒ Object
iterate through each model in the drawing and yield them
292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/microstation/drawing.rb', line 292 def each_model result = [] ole_obj.Models.each do |el| model = model_from_ole(el) if block_given? yield model else result << model end end result unless block_given? end |
#eval_cexpression(string) ⇒ Object
261 262 263 |
# File 'lib/microstation/drawing.rb', line 261 def eval_cexpression(string) app.eval_cexpression(string) end |
#find_by_id(id) ⇒ Object
Iterates through all the models and finds the ole_el with id
387 388 389 390 391 392 393 |
# File 'lib/microstation/drawing.rb', line 387 def find_by_id(id) models.each do |model| el = model.find_by_id(id) return el if el end nil end |
#find_line_element ⇒ Object
585 586 587 588 589 590 591 |
# File 'lib/microstation/drawing.rb', line 585 def find_line_element line = nil self.scan_lines do |el| line = el if el.microstation_type == MSD::MsdElementTypeLine end line end |
#find_model(name) ⇒ Model?
Find the model in the drawing
324 325 326 327 328 329 330 |
# File 'lib/microstation/drawing.rb', line 324 def find_model(name) ole = ole_obj.Models(name) model_from_ole(ole) rescue puts "model #{name} not found" nil end |
#find_tagset_instance_by_name(name) ⇒ Object
486 487 488 |
# File 'lib/microstation/drawing.rb', line 486 def (name) (ts_name: name).first end |
#find_tagset_instance_by_name_and_id(name, id) ⇒ Object
490 491 492 |
# File 'lib/microstation/drawing.rb', line 490 def (name,id) (ts_name: name, base_element_id: id).first end |
#find_tagset_instance_from_hash(ti_array, h_local) ⇒ Object
533 534 535 536 537 538 539 540 541 |
# File 'lib/microstation/drawing.rb', line 533 def (ti_array, h_local) id = h_local.fetch('microstation_id', :not_found) if id == :not_found || id.nil? name = ti_array.first.name raise MultipleUpdateError, "found #{ti_array.size} instances for tagset #{name}; Need a microstation_id for hash" end ts = ti_array.find{|ti| ti.microstation_id == id} end |
#find_tagset_instances_called? ⇒ Boolean
41 42 43 |
# File 'lib/microstation/drawing.rb', line 41 def @find_tagset_instances_called end |
#find_tagsets ⇒ Object
494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/microstation/drawing.rb', line 494 def results = [] each_model do |m| m..each do |ts| if block_given? yield ts else results << ts end end end return results unless block_given? end |
#get_matching_text(re, &block) ⇒ Object
350 351 352 |
# File 'lib/microstation/drawing.rb', line 350 def get_matching_text(re,&block) active_model.get_matching_text(re,&block) end |
#get_selected_elements ⇒ Object
341 342 343 344 |
# File 'lib/microstation/drawing.rb', line 341 def get_selected_elements return [] unless has_active_model? active_model.get_selected_elements end |
#get_selected_text ⇒ Object
346 347 348 |
# File 'lib/microstation/drawing.rb', line 346 def get_selected_text active_model.get_selected_text end |
#get_tagsets_in_drawing_hash(ts_name: nil, base_element_id: nil) ⇒ Object
used
473 474 475 476 477 478 479 480 |
# File 'lib/microstation/drawing.rb', line 473 def (ts_name: nil, base_element_id: nil) return to_enum(__callee__, ts_name: ts_name, base_element_id: base_element_id) unless block_given? each_model do |m| m.(ts_name: ts_name, base_element_id: base_element_id) do |tsi| yield tsi end end end |
#get_text(&block) ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/microstation/drawing.rb', line 159 def get_text(&block) result = [] scan_text do |te| if block_given? yield te.to_s else result << te.to_s end end result end |
#has_active_model? ⇒ Boolean
Returns true if drawing has an active model.
208 209 210 |
# File 'lib/microstation/drawing.rb', line 208 def has_active_model? app_ole_obj.HasActiveModelReference end |
#model_names ⇒ Array<String>
Returns the model names
374 375 376 377 378 379 380 381 |
# File 'lib/microstation/drawing.rb', line 374 def model_names result = [] ole_obj.Models.each do |el| result << el.name el = nil end result end |
#models ⇒ Object
337 338 339 |
# File 'lib/microstation/drawing.rb', line 337 def models @models ||= each_model end |
#modified_date ⇒ Date
Returns date last modified.
214 215 216 |
# File 'lib/microstation/drawing.rb', line 214 def modified_date ole_obj.DateLastSaved end |
#multiple_models? ⇒ Boolean
Returns true if drawing has more than 1 model.
333 334 335 |
# File 'lib/microstation/drawing.rb', line 333 def multiple_models? ole_obj.Models.Count > 1 end |
#name ⇒ String
Returns the name of the drawing.
238 239 240 |
# File 'lib/microstation/drawing.rb', line 238 def name ole_obj.Name end |
#new_model(name, template = nil) ⇒ Object
Create a new model
308 309 310 311 312 313 |
# File 'lib/microstation/drawing.rb', line 308 def new_model(name,template = nil) template_ole = template ? template.ole_obj : app.ole_obj.ActiveDesignFile.DefaultModelReference el = app.ole_obj.ActiveDesignFile.Models.Add(template_ole,name,"Added ") m = model_from_ole(el).activate m end |
#number ⇒ Object
16 17 18 19 |
# File 'lib/microstation/extensions/faa.rb', line 16 def number binding.pry Drawing::Number.from_string(self.basename) end |
#ole_obj ⇒ WIN32OLE
returns the internal ole_obj
570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/microstation/drawing.rb', line 570 def ole_obj is_ok = true begin @ole_obj.Name rescue StandardError => e is_ok = false end unless is_ok || drawing_closed? binding.pry end @ole_obj end |
#path ⇒ Pathname
Returns the complete path of file.
253 254 255 |
# File 'lib/microstation/drawing.rb', line 253 def path dirname + basename end |
#pdf_driver ⇒ Object
281 282 283 |
# File 'lib/microstation/drawing.rb', line 281 def pdf_driver app.windows_path( (::Microstation.plot_driver_directory + "pdf-bw.plt").to_s) end |
#pdf_name(name = nil) ⇒ Object
276 277 278 279 |
# File 'lib/microstation/drawing.rb', line 276 def pdf_name(name = nil) name = self.name unless name return Pathname(name).sub_ext(".pdf") end |
#pen_table ⇒ Object
285 286 287 |
# File 'lib/microstation/drawing.rb', line 285 def pen_table app.windows_path( (::Microstation.plot_driver_directory + 'wmbw.tbl')) end |
#read_only? ⇒ Boolean
Returns is the drawing readonly?.
124 125 126 |
# File 'lib/microstation/drawing.rb', line 124 def read_only? active_model_reference.IsReadOnly end |
#reset_tagset_instances ⇒ Object
45 46 47 |
# File 'lib/microstation/drawing.rb', line 45 def @find_tagset_instances_called = false end |
#revision_count ⇒ Object
257 258 259 |
# File 'lib/microstation/drawing.rb', line 257 def revision_count ole_obj.DesignRevisionCount end |
#save ⇒ void
This method returns an undefined value.
Save the drawing
415 416 417 |
# File 'lib/microstation/drawing.rb', line 415 def save ole_obj.Save end |
#save_as(name, overwrite: false, format: 0) ⇒ void
This method returns an undefined value.
Save the drawing under a different name
101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/microstation/drawing.rb', line 101 def save_as(name,overwrite: false, format: 0) @drawing_saved = false path = Pathname(name). wpath = app.windows_path(name) begin ole_obj.SaveAs(wpath,overwrite, format) wait_save_event(10) raise "drawing not saved in 10 seconds" unless @drawing_saved rescue => e binding.pry end end |
#save_as_pdf(name: nil, dir: nil) ⇒ void
This method returns an undefined value.
save the drawing as a pdf file if the name or directory is given it uses those params. If not it uses the drawing name and the drawing directory
82 83 84 85 86 87 88 89 90 |
# File 'lib/microstation/drawing.rb', line 82 def save_as_pdf(name: nil , dir: nil) out_name = pdf_path(name: name, dir: dir) windows_name = app.windows_path(out_name) loop do print_pdf(windows_name) break if out_name.file? end puts "saved #{windows_name}" end |
#save_tagsets_to_file(name) ⇒ Object
467 468 469 470 |
# File 'lib/microstation/drawing.rb', line 467 def (name) require 'json' ::File.open(name, 'w'){ |f| f.write .to_a.to_json } end |
#scan_all(criteria, &block) ⇒ Object
scans all the drawing models with criteria calls scan_all_with_block calls scal_all_with_hash
145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/microstation/drawing.rb', line 145 def scan_all(criteria,&block) return to_enum(__callee__, criteria) unless block_given? each_model do |m| m.scan_model(criteria) do |r| if block_given? yield r else result << r end end end end |
#scan_cells {|Cell| ... } ⇒ Object
scan all cells in drawing and
186 187 188 |
# File 'lib/microstation/drawing.rb', line 186 def scan_cells(&block) scan_all(cells_criteria,&block) end |
#scan_model(criteria, model: default_model_reference) { ... } ⇒ Object
Scan the drawing. It takes a criteria and an optional model scan the drawing
134 135 136 137 138 |
# File 'lib/microstation/drawing.rb', line 134 def scan_model(criteria, model: default_model_reference, &block) criteria = criteria || create_scan_criteria model = model || default_model_reference model.scan_model(criteria,&block) end |
#scan_tags {|Tag| ... } ⇒ Object
scan all tags in drawing and
180 181 182 |
# File 'lib/microstation/drawing.rb', line 180 def (&block) scan_all(, &block) end |
#scan_text {|String| ... } ⇒ Object
scan all text and text regions in all models
174 175 176 |
# File 'lib/microstation/drawing.rb', line 174 def scan_text(&block) scan_all(text_criteria,&block) end |
#scan_text_in_cells(&block) ⇒ Object
190 191 192 193 194 |
# File 'lib/microstation/drawing.rb', line 190 def scan_text_in_cells(&block) scan_cells do |c| c.text_elements(&block) end end |
#select_tagset_instances_by_name(name) ⇒ Object
482 483 484 |
# File 'lib/microstation/drawing.rb', line 482 def (name) (ts_name: name) end |
#tagsets_in_drawing ⇒ Object
453 454 455 |
# File 'lib/microstation/drawing.rb', line 453 def @tagset_instances ||= end |
#tagsets_in_drawing! ⇒ Object
457 458 459 460 |
# File 'lib/microstation/drawing.rb', line 457 def @tagset_instances = nil end |
#three_d? ⇒ Boolean
Returns true if a 3d drawing.
233 234 235 |
# File 'lib/microstation/drawing.rb', line 233 def three_d? dimensions == 3 end |
#to_ole_point3d(pt) ⇒ Object
593 594 595 |
# File 'lib/microstation/drawing.rb', line 593 def to_ole_point3d(pt) app.to_ole_point3d(pt) end |
#to_point(pt) ⇒ Object
614 615 616 |
# File 'lib/microstation/drawing.rb', line 614 def to_point(pt) app.to_point(pt) end |
#two_d? ⇒ Boolean
Returns true if a 2d drawing.
228 229 230 |
# File 'lib/microstation/drawing.rb', line 228 def two_d? dimensions == 2 end |
#update_error ⇒ Object
552 553 554 |
# File 'lib/microstation/drawing.rb', line 552 def update_error raise ArgumentError, 'Argument must be an array of hashes' end |
#update_tagset(name, h_local = {}) ⇒ Object
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/microstation/drawing.rb', line 510 def (name,h_local={}) tset_instances = (name) case tset_instances.size when 0 raise 'no tagset found' when 1 ts = tset_instances.first ts.update(h_local) else if (h_local.class == Array && h_local.all?{|l| l.class == Hash}) h_local.each do |update_hash| ts = (tset_instances, update_hash) ts.update(update_hash) end elsif h_local.class == Hash ts = (tset_instances, h_local) ts.update(h_local) else raise ArgumentError, "don't know how to update tagset" end end end |
#update_tagsets(ts_arg) ⇒ Object
543 544 545 546 547 548 549 550 |
# File 'lib/microstation/drawing.rb', line 543 def (ts_arg) return if ts_arg == [] return if ts_arg == {} ts_array = [ts_arg] if ts_arg.class == Hash ts_array.each do |hash_pair| (hash_pair.keys[0], hash_pair.values[0]) end end |
#update_tagsets_from_template_structure(ts_arg) ⇒ Object
556 557 558 559 560 561 562 563 |
# File 'lib/microstation/drawing.rb', line 556 def (ts_arg) ts_arg.each do |h| inst_array = h['instances'] inst_array.each do |ts_hash| (ts_hash['tagset_name'], ts_hash['attributes']) end end end |
#wait_save_event(secs, interval = 0.5) ⇒ Object
114 115 116 117 118 119 120 121 |
# File 'lib/microstation/drawing.rb', line 114 def wait_save_event(secs, interval = 0.5) elapsed = 0 while(!@drawing_saved && elapsed <= 5) elapsed += interval sleep(interval) WIN32OLE_EVENT. end end |
#zoom_to_element(target, n_view) ⇒ Object
395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/microstation/drawing.rb', line 395 def zoom_to_element(target, n_view) return nil unless target.graphical? zoom = 4 range = target.Range oview = app_ole_obj.ActiveDesignFile.Views.Item(n_view) range_diff = app_ole_obj.Point3dSubtract(range.High, range.Low) extent = app_ole_obj.Point3dScale(range_diff, zoom) oview_origin = app_ole_obj.Point3dSubtract(range.Low, app_ole_obj.Point3dScale(extent,0.5)) oview.Origin = oview_origin oview.Extents = extent oview.Redraw target.IsHighlighted = true end |