microstation 0.4.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.autotest +23 -23
- data/.rspec +2 -2
- data/Gemfile +28 -10
- data/History.txt +6 -6
- data/LICENSE.adoc +22 -0
- data/Manifest.txt +81 -60
- data/README.adoc +131 -0
- data/Rakefile +71 -30
- data/bin/dgn2pdf +36 -37
- data/bin/dgn_template +107 -0
- data/bin/microstation +231 -0
- data/bin/pw_print +35 -0
- data/cad_files/drawing_faatitle_in_non_default_model.dgn +0 -0
- data/cad_files/drawing_no_block.dgn +0 -0
- data/cad_files/drawing_with_3_block.dgn +0 -0
- data/cad_files/drawing_with_block.dgn +0 -0
- data/cad_files/seed2d.dgn +0 -0
- data/cad_files/test.dgn +0 -0
- data/lib/microstation.rb +252 -88
- data/lib/microstation/app.rb +781 -286
- data/lib/microstation/cad_input_queue.rb +100 -25
- data/lib/microstation/cell.rb +191 -0
- data/lib/microstation/changer.rb +70 -0
- data/lib/microstation/configuration.rb +193 -57
- data/lib/microstation/criteria_creation_t.rb +23 -0
- data/lib/microstation/dir.rb +252 -252
- data/lib/microstation/directory.rb +46 -0
- data/lib/microstation/drawing.rb +690 -189
- data/lib/microstation/element.rb +311 -0
- data/lib/microstation/enumerator.rb +32 -29
- data/lib/microstation/errors.rb +17 -0
- data/lib/microstation/event_handler.rb +28 -0
- data/lib/microstation/ext/pathname.rb +23 -25
- data/lib/microstation/ext/win32ole.rb +7 -0
- data/lib/microstation/extensions/faa.rb +124 -0
- data/lib/microstation/file_tests.rb +68 -0
- data/lib/microstation/functions.rb +60 -0
- data/lib/microstation/graphics.rb +35 -0
- data/lib/microstation/line.rb +19 -0
- data/lib/microstation/model.rb +45 -0
- data/lib/microstation/model_trait.rb +189 -0
- data/lib/microstation/ole_cad_input_message.rb +101 -0
- data/lib/microstation/ole_helper.rb +152 -0
- data/lib/microstation/pdf_support.rb +40 -40
- data/lib/microstation/point3d.rb +71 -0
- data/lib/microstation/primitive_command_interface.rb +66 -0
- data/lib/microstation/properties.rb +61 -57
- data/lib/microstation/property_handler.rb +48 -0
- data/lib/microstation/scan/color.rb +38 -38
- data/lib/microstation/scan/criteria.rb +89 -85
- data/lib/microstation/scan/klass.rb +43 -43
- data/lib/microstation/scan/level.rb +38 -38
- data/lib/microstation/scan/line_style.rb +45 -45
- data/lib/microstation/scan/line_weight.rb +33 -33
- data/lib/microstation/scan/range.rb +19 -0
- data/lib/microstation/scan/scan_trait.rb +51 -0
- data/lib/microstation/scan/subtype.rb +40 -40
- data/lib/microstation/scan/type.rb +134 -109
- data/lib/microstation/scan_trait.rb +62 -0
- data/lib/microstation/scanner.rb +24 -24
- data/lib/microstation/tag.rb +87 -58
- data/lib/microstation/tag_set.rb +385 -280
- data/lib/microstation/tag_set_trait.rb +51 -0
- data/lib/microstation/tagged_element.rb +105 -0
- data/lib/microstation/template.rb +90 -84
- data/lib/microstation/template_info.rb +172 -0
- data/lib/microstation/template_runner.rb +65 -0
- data/lib/microstation/text.rb +79 -54
- data/lib/microstation/text_node.rb +124 -74
- data/lib/microstation/ts/attribute.rb +140 -139
- data/lib/microstation/ts/instance.rb +146 -112
- data/lib/microstation/ts/tagset_trait.rb +49 -0
- data/lib/microstation/types.rb +91 -91
- data/lib/microstation/version.rb +5 -0
- data/lib/microstation/wrap.rb +28 -214
- data/plot/pdf-bw.plt +164 -164
- data/plot/pdf.plt +163 -163
- data/plot/png.plt +383 -383
- data/plot/tiff.plt +384 -384
- data/plot/wmbw.tbl +324 -66
- data/plot/wmcolor.tbl +62 -62
- metadata +301 -86
- data/.gemtest +0 -0
- data/README.txt +0 -75
- data/lib/microstation/attributes.rb +0 -35
- data/lib/microstation/extensions/hash.rb +0 -27
- data/spec/app_spec.rb +0 -267
- data/spec/configuration_spec.rb +0 -122
- data/spec/drawing_spec.rb +0 -247
- data/spec/drawings/new_drawing.dgn +0 -0
- data/spec/drawings/test.dgn +0 -0
- data/spec/drawings/test1.dgn +0 -0
- data/spec/drawings/testfile.pdf +0 -0
- data/spec/enumerator_spec.rb +0 -60
- data/spec/microstation_spec.rb +0 -36
- data/spec/scanner_spec.rb +0 -155
- data/spec/spec_app.rb +0 -11
- data/spec/spec_helper.rb +0 -31
- data/spec/tag_set_spec.rb +0 -123
- data/spec/text_node_spec.rb +0 -92
- data/spec/text_spec.rb +0 -62
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
module Microstation
|
|
2
|
-
|
|
3
|
-
module Properties
|
|
4
|
-
|
|
5
|
-
def author=(var = nil)
|
|
6
|
-
if var
|
|
7
|
-
@ole_obj.Author = var
|
|
8
|
-
else
|
|
9
|
-
@ole_obj.Author rescue nil
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
alias_method :author, :author=
|
|
15
|
-
|
|
16
|
-
def subject=(var = nil)
|
|
17
|
-
if var
|
|
18
|
-
@ole_obj.Subject = var
|
|
19
|
-
else
|
|
20
|
-
@ole_obj.Subject rescue nil
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
alias_method :subject, :subject=
|
|
26
|
-
|
|
27
|
-
def comments=(var = nil)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
module Microstation
|
|
2
|
+
|
|
3
|
+
module Properties
|
|
4
|
+
|
|
5
|
+
def author=(var = nil)
|
|
6
|
+
if var
|
|
7
|
+
@ole_obj.Author = var
|
|
8
|
+
else
|
|
9
|
+
@ole_obj.Author rescue nil
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
alias_method :author, :author=
|
|
15
|
+
|
|
16
|
+
def subject=(var = nil)
|
|
17
|
+
if var
|
|
18
|
+
@ole_obj.Subject = var
|
|
19
|
+
else
|
|
20
|
+
@ole_obj.Subject rescue nil
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
alias_method :subject, :subject=
|
|
26
|
+
|
|
27
|
+
def comments=(var = nil)
|
|
28
|
+
if var
|
|
29
|
+
@ole_obj.Comments = var
|
|
30
|
+
else
|
|
31
|
+
@ole_obj.Comments rescue nil
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
alias_method :comments, :comments=
|
|
36
|
+
|
|
37
|
+
def title=(var = nil)
|
|
38
|
+
if var
|
|
39
|
+
@ole_obj.Title = var
|
|
40
|
+
else
|
|
41
|
+
@ole_obj.Title rescue nil
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
alias_method :title,:title=
|
|
46
|
+
|
|
47
|
+
def keywords=(var = nil)
|
|
48
|
+
if var
|
|
49
|
+
@ole_obj.Keywords = var
|
|
50
|
+
else
|
|
51
|
+
@ole_obj.Keywords rescue nil
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
alias_method :keywords, :keywords=
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module Microstation
|
|
2
|
+
|
|
3
|
+
class PropertyHandler
|
|
4
|
+
|
|
5
|
+
attr_reader :ole_obj
|
|
6
|
+
|
|
7
|
+
def initialize(ole)
|
|
8
|
+
@ole_obj = ole
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def has_property?(value)
|
|
12
|
+
prop = ole_obj.SelectByAccessString(value)
|
|
13
|
+
!!(prop)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def [](property)
|
|
17
|
+
return unless has_property?(property)
|
|
18
|
+
ole_obj.GetValue
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def get_property_as_point3d(property)
|
|
22
|
+
return unless has_property?(property)
|
|
23
|
+
ole_pt = ole_obj.GetValueAsPoint3d
|
|
24
|
+
Point3d.new(ole_pt)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def []=(property,value)
|
|
29
|
+
return unless has_property?(property)
|
|
30
|
+
ole_obj.SetValue(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def property_names
|
|
34
|
+
names = ole_obj.GetAccessStrings
|
|
35
|
+
result = []
|
|
36
|
+
names.each do |e|
|
|
37
|
+
if block_given?
|
|
38
|
+
yield e
|
|
39
|
+
else
|
|
40
|
+
result << e
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
result unless block_given?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
module Microstation
|
|
2
|
-
|
|
3
|
-
module Scan
|
|
4
|
-
|
|
5
|
-
module Color
|
|
6
|
-
|
|
7
|
-
def color_inclusions
|
|
8
|
-
@color_inclusions ||= []
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def include_color(color)
|
|
12
|
-
color_inclusions << color
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def reset_colors
|
|
16
|
-
reset_ole_colors
|
|
17
|
-
@color_inclusions = []
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def reset_ole_colors
|
|
21
|
-
ole_obj.ExcludeAllColors
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def resolve_color_scans
|
|
25
|
-
return unless color_inclusions.size > 0
|
|
26
|
-
reset_ole_colors
|
|
27
|
-
color_inclusions.each do |color|
|
|
28
|
-
ole_obj.IncludeColor(color)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
module Microstation
|
|
2
|
+
|
|
3
|
+
module Scan
|
|
4
|
+
|
|
5
|
+
module Color
|
|
6
|
+
|
|
7
|
+
def color_inclusions
|
|
8
|
+
@color_inclusions ||= []
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def include_color(color)
|
|
12
|
+
color_inclusions << color
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def reset_colors
|
|
16
|
+
reset_ole_colors
|
|
17
|
+
@color_inclusions = []
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def reset_ole_colors
|
|
21
|
+
ole_obj.ExcludeAllColors
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def resolve_color_scans
|
|
25
|
+
return unless color_inclusions.size > 0
|
|
26
|
+
reset_ole_colors
|
|
27
|
+
color_inclusions.each do |color|
|
|
28
|
+
ole_obj.IncludeColor(color)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -1,85 +1,89 @@
|
|
|
1
|
-
require_relative 'klass'
|
|
2
|
-
require_relative 'type'
|
|
3
|
-
require_relative 'level'
|
|
4
|
-
require_relative 'color'
|
|
5
|
-
require_relative 'line_style'
|
|
6
|
-
require_relative 'line_weight'
|
|
7
|
-
require_relative 'subtype'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
include Scan::
|
|
29
|
-
include Scan::
|
|
30
|
-
include Scan::
|
|
31
|
-
include Scan::
|
|
32
|
-
include Scan::
|
|
33
|
-
include Scan::
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
sc
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
sc
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
@ole_obj
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def
|
|
78
|
-
@ole_obj
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
require_relative 'klass'
|
|
2
|
+
require_relative 'type'
|
|
3
|
+
require_relative 'level'
|
|
4
|
+
require_relative 'color'
|
|
5
|
+
require_relative 'line_style'
|
|
6
|
+
require_relative 'line_weight'
|
|
7
|
+
require_relative 'subtype'
|
|
8
|
+
require_relative 'range'
|
|
9
|
+
|
|
10
|
+
module Microstation
|
|
11
|
+
|
|
12
|
+
class App
|
|
13
|
+
|
|
14
|
+
def create_ole_scan_criteria
|
|
15
|
+
ole_obj.CreateObjectInMicroStation("MicroStationDGN.ElementScanCriteria")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
module Microstation
|
|
23
|
+
|
|
24
|
+
module Scan
|
|
25
|
+
|
|
26
|
+
class Criteria
|
|
27
|
+
|
|
28
|
+
include Scan::Klass
|
|
29
|
+
include Scan::Type
|
|
30
|
+
include Scan::Level
|
|
31
|
+
include Scan::Color
|
|
32
|
+
include Scan::LineStyle
|
|
33
|
+
include Scan::LineWeight
|
|
34
|
+
include Scan::Subtype
|
|
35
|
+
include Scan::Range
|
|
36
|
+
|
|
37
|
+
attr_reader :app
|
|
38
|
+
|
|
39
|
+
def self.create_scanner(name=nil, app,&block)
|
|
40
|
+
sc = create(name,app)
|
|
41
|
+
return sc unless block
|
|
42
|
+
block.arity < 1 ? sc.instance_eval(&block) : block.call(sc)
|
|
43
|
+
sc
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.create(name=nil,app)
|
|
47
|
+
sc = new(app)
|
|
48
|
+
if name.nil?
|
|
49
|
+
name = "anon#{app.scanners.size + 1}"
|
|
50
|
+
end
|
|
51
|
+
app.scanners[name] = sc
|
|
52
|
+
sc
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def initialize(app)
|
|
57
|
+
@app = app
|
|
58
|
+
@ole_obj = @app.create_ole_scan_criteria
|
|
59
|
+
@app.load_constants unless defined? ::Microstation::MSD
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def resolve
|
|
63
|
+
resolve_type_scans
|
|
64
|
+
resolve_class_scans
|
|
65
|
+
resolve_color_scans
|
|
66
|
+
resolve_level_scans
|
|
67
|
+
resolve_linestyle_scans
|
|
68
|
+
resolve_lineweight_scans
|
|
69
|
+
resolve_subtype_scans
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def close
|
|
73
|
+
@app.scanners.delete(self) if @app
|
|
74
|
+
@ole_obj = nil
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def ole_obj
|
|
78
|
+
@ole_obj
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def method_missing(method,*args)
|
|
82
|
+
@ole_obj.send(method,*args)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
end
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
module Microstation
|
|
2
|
-
|
|
3
|
-
module Scan
|
|
4
|
-
|
|
5
|
-
module Klass
|
|
6
|
-
|
|
7
|
-
# msdElementClassPrimary # 0 (&H0)
|
|
8
|
-
# msdElementClassPatternComponent #1 (&H1)
|
|
9
|
-
# msdElementClassConstruction #2 (&H2)
|
|
10
|
-
# msdElementClassDimension #3 (&H3)
|
|
11
|
-
# msdElementClassPrimaryRule #4 (&H4)
|
|
12
|
-
# msdElementClassLinearPatterned #5 (&H5)
|
|
13
|
-
# msdElementClassContructionRule #6 (&H6)
|
|
14
|
-
|
|
15
|
-
def class_inclusions
|
|
16
|
-
@class_inclusions ||= []
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def reset_classes
|
|
20
|
-
reset_ole_classes
|
|
21
|
-
@class_inclusions = []
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def reset_ole_classes
|
|
25
|
-
ole_obj.ExcludeAllClasses
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def include_class(klass)
|
|
29
|
-
class_inclusions << klass
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def resolve_class_scans
|
|
33
|
-
return unless class_inclusions.size > 0
|
|
34
|
-
reset_ole_classes
|
|
35
|
-
class_inclusions.each do |klass|
|
|
36
|
-
ole_obj.IncludeClass(klass)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
end
|
|
1
|
+
module Microstation
|
|
2
|
+
|
|
3
|
+
module Scan
|
|
4
|
+
|
|
5
|
+
module Klass
|
|
6
|
+
|
|
7
|
+
# msdElementClassPrimary # 0 (&H0)
|
|
8
|
+
# msdElementClassPatternComponent #1 (&H1)
|
|
9
|
+
# msdElementClassConstruction #2 (&H2)
|
|
10
|
+
# msdElementClassDimension #3 (&H3)
|
|
11
|
+
# msdElementClassPrimaryRule #4 (&H4)
|
|
12
|
+
# msdElementClassLinearPatterned #5 (&H5)
|
|
13
|
+
# msdElementClassContructionRule #6 (&H6)
|
|
14
|
+
|
|
15
|
+
def class_inclusions
|
|
16
|
+
@class_inclusions ||= []
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def reset_classes
|
|
20
|
+
reset_ole_classes
|
|
21
|
+
@class_inclusions = []
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def reset_ole_classes
|
|
25
|
+
ole_obj.ExcludeAllClasses
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def include_class(klass)
|
|
29
|
+
class_inclusions << klass
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def resolve_class_scans
|
|
33
|
+
return unless class_inclusions.size > 0
|
|
34
|
+
reset_ole_classes
|
|
35
|
+
class_inclusions.each do |klass|
|
|
36
|
+
ole_obj.IncludeClass(klass)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|