microstation 0.4.1 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +23 -23
  3. data/.rspec +2 -2
  4. data/Gemfile +29 -10
  5. data/History.txt +6 -6
  6. data/LICENSE.adoc +22 -0
  7. data/Manifest.txt +91 -60
  8. data/README.adoc +131 -0
  9. data/Rakefile +72 -30
  10. data/bin/dgn2pdf +36 -37
  11. data/bin/dgn_template +107 -0
  12. data/bin/pw_print +35 -0
  13. data/cad_files/drawing_faatitle_in_non_default_model.dgn +0 -0
  14. data/cad_files/drawing_no_block.dgn +0 -0
  15. data/cad_files/drawing_with_3_block.dgn +0 -0
  16. data/cad_files/drawing_with_block.dgn +0 -0
  17. data/cad_files/drawing_with_text.dgn +0 -0
  18. data/cad_files/seed2d.dgn +0 -0
  19. data/cad_files/seed3d.dgn +0 -0
  20. data/lib/microstation/app.rb +781 -286
  21. data/lib/microstation/cad_input_queue.rb +100 -25
  22. data/lib/microstation/cell.rb +191 -0
  23. data/lib/microstation/changer.rb +70 -0
  24. data/lib/microstation/configuration.rb +193 -57
  25. data/lib/microstation/criteria_creation_t.rb +23 -0
  26. data/lib/microstation/dir.rb +252 -252
  27. data/lib/microstation/directory.rb +46 -0
  28. data/lib/microstation/drawing.rb +686 -189
  29. data/lib/microstation/element.rb +311 -0
  30. data/lib/microstation/enumerator.rb +32 -29
  31. data/lib/microstation/errors.rb +17 -0
  32. data/lib/microstation/event_handler.rb +28 -0
  33. data/lib/microstation/ext/pathname.rb +23 -25
  34. data/lib/microstation/ext/win32ole.rb +7 -0
  35. data/lib/microstation/extensions/faa.rb +124 -0
  36. data/lib/microstation/file_tests.rb +68 -0
  37. data/lib/microstation/functions.rb +60 -0
  38. data/lib/microstation/graphics.rb +35 -0
  39. data/lib/microstation/line.rb +19 -0
  40. data/lib/microstation/model.rb +45 -0
  41. data/lib/microstation/model_trait.rb +189 -0
  42. data/lib/microstation/ole_cad_input_message.rb +101 -0
  43. data/lib/microstation/ole_helper.rb +152 -0
  44. data/lib/microstation/pdf_support.rb +40 -40
  45. data/lib/microstation/point3d.rb +71 -0
  46. data/lib/microstation/primitive_command_interface.rb +66 -0
  47. data/lib/microstation/properties.rb +61 -57
  48. data/lib/microstation/property_handler.rb +48 -0
  49. data/lib/microstation/scan/color.rb +38 -38
  50. data/lib/microstation/scan/criteria.rb +89 -85
  51. data/lib/microstation/scan/klass.rb +43 -43
  52. data/lib/microstation/scan/level.rb +38 -38
  53. data/lib/microstation/scan/line_style.rb +45 -45
  54. data/lib/microstation/scan/line_weight.rb +33 -33
  55. data/lib/microstation/scan/range.rb +19 -0
  56. data/lib/microstation/scan/scan_trait.rb +51 -0
  57. data/lib/microstation/scan/subtype.rb +40 -40
  58. data/lib/microstation/scan/type.rb +134 -109
  59. data/lib/microstation/scan_trait.rb +62 -0
  60. data/lib/microstation/scanner.rb +24 -24
  61. data/lib/microstation/tag.rb +87 -58
  62. data/lib/microstation/tag_set.rb +385 -280
  63. data/lib/microstation/tag_set_trait.rb +51 -0
  64. data/lib/microstation/tagged_element.rb +105 -0
  65. data/lib/microstation/template.rb +90 -84
  66. data/lib/microstation/template_info.rb +172 -0
  67. data/lib/microstation/template_runner.rb +65 -0
  68. data/lib/microstation/text.rb +79 -54
  69. data/lib/microstation/text_node.rb +124 -74
  70. data/lib/microstation/ts/attribute.rb +140 -139
  71. data/lib/microstation/ts/instance.rb +146 -112
  72. data/lib/microstation/ts/tagset_trait.rb +49 -0
  73. data/lib/microstation/types.rb +91 -91
  74. data/lib/microstation/version.rb +5 -0
  75. data/lib/microstation/wrap.rb +28 -214
  76. data/lib/microstation.rb +252 -88
  77. data/plot/pdf-bw.plt +164 -164
  78. data/plot/pdf.plt +163 -163
  79. data/plot/png.plt +383 -383
  80. data/plot/tiff.plt +384 -384
  81. data/plot/wmbw.tbl +324 -66
  82. data/plot/wmcolor.tbl +62 -62
  83. data/spec/microstation/app_spec.rb +184 -0
  84. data/spec/microstation/configuration_spec.rb +131 -0
  85. data/spec/microstation/drawing_spec.rb +245 -0
  86. data/spec/microstation/functions_spec.rb +36 -0
  87. data/spec/microstation/tag_set_spec.rb +159 -0
  88. data/spec/microstation/template_spec.rb +159 -0
  89. data/spec/microstation/text_node_spec.rb +67 -0
  90. data/spec/microstation/text_spec.rb +42 -0
  91. data/spec/microstation_spec.rb +47 -36
  92. data/spec/spec_helper.rb +97 -31
  93. metadata +308 -84
  94. data/.gemtest +0 -0
  95. data/README.txt +0 -75
  96. data/lib/microstation/attributes.rb +0 -35
  97. data/lib/microstation/extensions/hash.rb +0 -27
  98. data/spec/app_spec.rb +0 -267
  99. data/spec/configuration_spec.rb +0 -122
  100. data/spec/drawing_spec.rb +0 -247
  101. data/spec/drawings/new_drawing.dgn +0 -0
  102. data/spec/drawings/test.dgn +0 -0
  103. data/spec/drawings/test1.dgn +0 -0
  104. data/spec/drawings/testfile.pdf +0 -0
  105. data/spec/enumerator_spec.rb +0 -60
  106. data/spec/scanner_spec.rb +0 -155
  107. data/spec/spec_app.rb +0 -11
  108. data/spec/tag_set_spec.rb +0 -123
  109. data/spec/text_node_spec.rb +0 -92
  110. data/spec/text_spec.rb +0 -62
data/plot/pdf-bw.plt CHANGED
@@ -1,164 +1,164 @@
1
- ;----------------------------------------------------------------------
2
- ;
3
- ; Portable Document file (PDF) Plotter Driver Configuration file
4
- ;
5
- ; Current Revision:
6
- ; $RCSfile: pdf.plt,v $
7
- ; $Revision: 1.1.2.16.2.1 $ $Date: 2004/03/23 21:07:42 $
8
- ;
9
- ;----------------------------------------------------------------------
10
-
11
- ;======================================================================
12
- ;
13
- ; >>>>> WARNING WARNING WARNING WARNING WARNING WARNING <<<<<
14
- ;
15
- ; Plotter driver configuration files are now stored in two directories:
16
- ;
17
- ; $(_USTN_WORKSPACEROOT)/System/plotdrv/
18
- ; $(_USTN_WORKSPACEROOT)/Standards/plotdrv/
19
- ;
20
- ; System/plotdrv/ should be reserved for .plt files delivered by
21
- ; MicroStation and other Bentley products. Standards/plotdrv/ is
22
- ; provided as a place for you to store customized .plt files. To
23
- ; simplify plotter selection from the Plot dialog, you may also
24
- ; elect to store frequently-used .plt files in Standards/plotdrv/
25
- ; even if you do not customize them.
26
- ;
27
- ; To minimize the risk of losing your changes during a product
28
- ; reinstallation, do not edit the files in the System/plotdrv/
29
- ; directory. Instead, copy the necessary files to Standards/plotdrv/
30
- ; and edit them there. If the .plt file depends on other files, such
31
- ; as PostScript prolog (*.pro) files, copy them to the same directory.
32
- ;
33
- ;======================================================================
34
- ; Construction/active points are plotted by default. Comment out the next line
35
- ; if you do not want points plotted.
36
-
37
- point_size = 0.03
38
- default_extension = 'pdf' ; default extension for plotfiles
39
- document_set
40
- model = mdl
41
- driver = pdf
42
- autocenter ; Automatically center plot on page
43
-
44
- ;num_pens = 255 ; required record, must precede any "pen" records.
45
- num_pens = 1 ; Monochrome
46
- change_pen = both
47
-
48
- ; Remove this record if no border is desired.
49
- ; Refer to the documentation for available border qualifiers.
50
- border /filename /time /text_height=0.35
51
-
52
- ; Substitute the name of a pentable file to be loaded when this driver is selected
53
- ;pentable=\dir\file.tbl
54
-
55
- ;=================================================================
56
- ;Turn the Book Marks on and off
57
- CmdName /appname="pdf" /command="BookMarks" /qualifier="On"
58
- ;CmdName /appname="pdf" /command="BookMarks" /qualifier="Off"
59
- ;on by default
60
- ;=================================================================
61
-
62
- ;=================================================================
63
- ;Turn the Level/File optional content on and off
64
- ;CmdName /appname="pdf" /command="FileOptionalContent" /qualifier="On"
65
- CmdName /appname="pdf" /command="FileOptionalContent" /qualifier="Off"
66
- ;off by default
67
- ;=================================================================
68
-
69
- ;=================================================================
70
- ;Turn Engineering links on and off
71
- CmdName /appname="pdf" /command="EngineeringLinks" /qualifier="On"
72
- ;CmdName /appname="pdf" /command="EngineeringLinks" /qualifier="Off"
73
- ;on by default
74
- ;=================================================================
75
-
76
- ;=================================================================
77
- ;pick the version of pdf you want to support
78
- CmdName /appname="pdf" /command="version" /qualifier="Acrobat 6 (PDF 1.5)/Viewable in Acrobat 5"
79
- ;CmdName /appname="pdf" /command="version" /qualifier="Acrobat 6 (PDF 1.5)"
80
- ;CmdName /appname="pdf" /command="version" /qualifier="Acrobat 5 (PDF 1.4)"
81
- ;=================================================================
82
-
83
- ;=================================================================
84
- ;uncomment the line and change the qualifier to your password
85
- ;if you wish to protect the output pdf file.
86
- ;NOTE the pdf file will not view with out the password
87
- ;But then is unprotected
88
- ;CmdName /appname="pdf" /command="userpassword" /qualifier="my_password"
89
- ;=================================================================
90
-
91
- ;=================================================================
92
- ;RGB Raster compression
93
- ;CmdName /appname="pdf" /command="RGBRasterCompression" /qualifier="jpeg"
94
- CmdName /appname="pdf" /command="RGBRasterCompression" /qualifier="zipped"
95
- ;zipped by default
96
- ;=================================================================
97
-
98
- ;=================================================================
99
- ;Searchable Text
100
- CmdName /appname="pdf" /command="SearchableText" /qualifier="on"
101
- ;CmdName /appname="pdf" /command="SearchableText" /qualifier="off"
102
- ;on by default
103
- ;=================================================================
104
-
105
-
106
- ; ENGLISH resolution and SIZE records
107
- size=(44,34)/num=0/off=(0,0)/name="ANSI E"
108
- size=(22,17)/num=0/off=(0,0)/name="ANSI C"
109
- size=(17,11)/num=0/off=(0,0)/name="ANSI B"
110
- size=(11,8.5)/num=0/off=(0,0)/name="ANSI A"
111
- size=(34,22)/num=0/off=(0,0)/name="ANSI D"
112
- resolution(IN)=(0.001666666666666666666667,0.001666666666666666666667) ;600DPI
113
-
114
- ; METRIC resolution and SIZE records
115
- ;size=(1189,841)/num=0/off=(0,0)/name="ISO A0"
116
- ;size=(841,594)/num=0/off=(0,0)/name="ISO A1"
117
- ;size=(594,420)/num=0/off=(0,0)/name="ISO A2"
118
- ;size=(420,297)/num=0/off=(0,0)/name="ISO A3"
119
- ;size=(297,210)/num=0/off=(0,0)/name="ISO A4"
120
- ;resolution(MM)=(0.04233333333333333333333,0.04233333333333333333333); 600DPI
121
-
122
- ; The style records define how the design file line codes (styles)
123
- ; are to be plotted. Values are in plotter units (resolutions).
124
- ; Values determine pen down/up movements, where (10,28) for a dot
125
- ; pattern leaves the pen down for 10 units and up for 28 units. The
126
- ; /nohardware switch causes software stroking with these values.
127
- ; This example has the /nohardware option commented
128
- ; out, so the printer will draw the styles.
129
-
130
- style(1)=(18, 18) ;/nohardware ;style = dot
131
- style(2)=(37, 37) ;/nohardware ;style = med dash
132
- style(3)=(75, 75) ;/nohardware ;style = long dash
133
- style(4)=(75, 37, 18, 37) ;/nohardware ;style = dot-dash
134
- style(5)=(27, 27) ;/nohardware ;style = short dash
135
- style(6)=(75, 37, 18, 37, 18, 37) ;/nohardware ;style = dash-dot-dot
136
- style(7)=(75, 27, 32, 27) ;/nohardware ;style = long dash - short dash
137
-
138
- stroke_tolerance=9.0
139
- largest_polygon=200000
140
- linecap = 0 ; 0=butt, 1=round, 2=square
141
- linejoin = 0 ; 0=mitered, 1=round, 2=bevel
142
- miter_limit = 3.0 ; larger values mean longer spikes
143
- ; 1=none, 1.415=90deg, 2=60deg, 10=11deg etc.
144
-
145
- ; Specify the mapping of MicroStation line weights to line thickness on paper.
146
- ; Units are MM, IN, or DOTS (the default)
147
-
148
- weight_strokes(mm)=(0.250, 0.375, 0.500, 0.625, 0.750, 0.875, 1.000, 1.125, \
149
- 1.250, 1.375, 1.500, 1.625, 1.750, 1.875, 2.000, 2.125, \
150
- 2.250, 2.375, 2.500, 2.625, 2.750, 2.875, 3.000, 3.125, \
151
- 3.250, 3.375, 3.500, 3.625, 3.750, 3.875, 4.000, 4.125)
152
-
153
-
154
-
155
- ; The following options control raster plotting.
156
- isv_raster=1 ; Plots the raster image, 1=On 0=Off Default=1
157
- pixel_resolution=300 ; Resolution of pixels on output (dpi) Default=300
158
- contrast=50 ; Contrast in percent, between 0-100 Default=50
159
- brightness=50 ; Brightness in percent, between 0-100 Default=50
160
- raster_fence=1 ; Clip the raster to fence, 1=On 0=Off Default=1
161
- grayscale=0 ; Plot in gray scale, 1=On 0=Off Default=0
162
- no_dgnraster=0 ; MS plot of 87/88, 1=Don't plot 0=Plot Default=0
163
- background = 0 ; 0=white,1=black,2=color Default=0
164
- no_rasterref=0 ; MS plot of 90's, 1=Don't plot 0=Plot Default=0
1
+ ;----------------------------------------------------------------------
2
+ ;
3
+ ; Portable Document file (PDF) Plotter Driver Configuration file
4
+ ;
5
+ ; Current Revision:
6
+ ; $RCSfile: pdf.plt,v $
7
+ ; $Revision: 1.1.2.16.2.1 $ $Date: 2004/03/23 21:07:42 $
8
+ ;
9
+ ;----------------------------------------------------------------------
10
+
11
+ ;======================================================================
12
+ ;
13
+ ; >>>>> WARNING WARNING WARNING WARNING WARNING WARNING <<<<<
14
+ ;
15
+ ; Plotter driver configuration files are now stored in two directories:
16
+ ;
17
+ ; $(_USTN_WORKSPACEROOT)/System/plotdrv/
18
+ ; $(_USTN_WORKSPACEROOT)/Standards/plotdrv/
19
+ ;
20
+ ; System/plotdrv/ should be reserved for .plt files delivered by
21
+ ; MicroStation and other Bentley products. Standards/plotdrv/ is
22
+ ; provided as a place for you to store customized .plt files. To
23
+ ; simplify plotter selection from the Plot dialog, you may also
24
+ ; elect to store frequently-used .plt files in Standards/plotdrv/
25
+ ; even if you do not customize them.
26
+ ;
27
+ ; To minimize the risk of losing your changes during a product
28
+ ; reinstallation, do not edit the files in the System/plotdrv/
29
+ ; directory. Instead, copy the necessary files to Standards/plotdrv/
30
+ ; and edit them there. If the .plt file depends on other files, such
31
+ ; as PostScript prolog (*.pro) files, copy them to the same directory.
32
+ ;
33
+ ;======================================================================
34
+ ; Construction/active points are plotted by default. Comment out the next line
35
+ ; if you do not want points plotted.
36
+
37
+ point_size = 0.03
38
+ default_extension = 'pdf' ; default extension for plotfiles
39
+ document_set
40
+ model = mdl
41
+ driver = pdf
42
+ autocenter ; Automatically center plot on page
43
+
44
+ ;num_pens = 255 ; required record, must precede any "pen" records.
45
+ num_pens = 1 ; Monochrome
46
+ change_pen = both
47
+
48
+ ; Remove this record if no border is desired.
49
+ ; Refer to the documentation for available border qualifiers.
50
+ border /filename /time /text_height=0.35
51
+
52
+ ; Substitute the name of a pentable file to be loaded when this driver is selected
53
+ ;pentable=\dir\file.tbl
54
+
55
+ ;=================================================================
56
+ ;Turn the Book Marks on and off
57
+ CmdName /appname="pdf" /command="BookMarks" /qualifier="On"
58
+ ;CmdName /appname="pdf" /command="BookMarks" /qualifier="Off"
59
+ ;on by default
60
+ ;=================================================================
61
+
62
+ ;=================================================================
63
+ ;Turn the Level/File optional content on and off
64
+ ;CmdName /appname="pdf" /command="FileOptionalContent" /qualifier="On"
65
+ CmdName /appname="pdf" /command="FileOptionalContent" /qualifier="Off"
66
+ ;off by default
67
+ ;=================================================================
68
+
69
+ ;=================================================================
70
+ ;Turn Engineering links on and off
71
+ CmdName /appname="pdf" /command="EngineeringLinks" /qualifier="On"
72
+ ;CmdName /appname="pdf" /command="EngineeringLinks" /qualifier="Off"
73
+ ;on by default
74
+ ;=================================================================
75
+
76
+ ;=================================================================
77
+ ;pick the version of pdf you want to support
78
+ CmdName /appname="pdf" /command="version" /qualifier="Acrobat 6 (PDF 1.5)/Viewable in Acrobat 5"
79
+ ;CmdName /appname="pdf" /command="version" /qualifier="Acrobat 6 (PDF 1.5)"
80
+ ;CmdName /appname="pdf" /command="version" /qualifier="Acrobat 5 (PDF 1.4)"
81
+ ;=================================================================
82
+
83
+ ;=================================================================
84
+ ;uncomment the line and change the qualifier to your password
85
+ ;if you wish to protect the output pdf file.
86
+ ;NOTE the pdf file will not view with out the password
87
+ ;But then is unprotected
88
+ ;CmdName /appname="pdf" /command="userpassword" /qualifier="my_password"
89
+ ;=================================================================
90
+
91
+ ;=================================================================
92
+ ;RGB Raster compression
93
+ ;CmdName /appname="pdf" /command="RGBRasterCompression" /qualifier="jpeg"
94
+ CmdName /appname="pdf" /command="RGBRasterCompression" /qualifier="zipped"
95
+ ;zipped by default
96
+ ;=================================================================
97
+
98
+ ;=================================================================
99
+ ;Searchable Text
100
+ CmdName /appname="pdf" /command="SearchableText" /qualifier="on"
101
+ ;CmdName /appname="pdf" /command="SearchableText" /qualifier="off"
102
+ ;on by default
103
+ ;=================================================================
104
+
105
+
106
+ ; ENGLISH resolution and SIZE records
107
+ size=(44,34)/num=0/off=(0,0)/name="ANSI E"
108
+ size=(22,17)/num=0/off=(0,0)/name="ANSI C"
109
+ size=(17,11)/num=0/off=(0,0)/name="ANSI B"
110
+ size=(11,8.5)/num=0/off=(0,0)/name="ANSI A"
111
+ size=(34,22)/num=0/off=(0,0)/name="ANSI D"
112
+ resolution(IN)=(0.001666666666666666666667,0.001666666666666666666667) ;600DPI
113
+
114
+ ; METRIC resolution and SIZE records
115
+ ;size=(1189,841)/num=0/off=(0,0)/name="ISO A0"
116
+ ;size=(841,594)/num=0/off=(0,0)/name="ISO A1"
117
+ ;size=(594,420)/num=0/off=(0,0)/name="ISO A2"
118
+ ;size=(420,297)/num=0/off=(0,0)/name="ISO A3"
119
+ ;size=(297,210)/num=0/off=(0,0)/name="ISO A4"
120
+ ;resolution(MM)=(0.04233333333333333333333,0.04233333333333333333333); 600DPI
121
+
122
+ ; The style records define how the design file line codes (styles)
123
+ ; are to be plotted. Values are in plotter units (resolutions).
124
+ ; Values determine pen down/up movements, where (10,28) for a dot
125
+ ; pattern leaves the pen down for 10 units and up for 28 units. The
126
+ ; /nohardware switch causes software stroking with these values.
127
+ ; This example has the /nohardware option commented
128
+ ; out, so the printer will draw the styles.
129
+
130
+ style(1)=(18, 18) ;/nohardware ;style = dot
131
+ style(2)=(37, 37) ;/nohardware ;style = med dash
132
+ style(3)=(75, 75) ;/nohardware ;style = long dash
133
+ style(4)=(75, 37, 18, 37) ;/nohardware ;style = dot-dash
134
+ style(5)=(27, 27) ;/nohardware ;style = short dash
135
+ style(6)=(75, 37, 18, 37, 18, 37) ;/nohardware ;style = dash-dot-dot
136
+ style(7)=(75, 27, 32, 27) ;/nohardware ;style = long dash - short dash
137
+
138
+ stroke_tolerance=9.0
139
+ largest_polygon=200000
140
+ linecap = 0 ; 0=butt, 1=round, 2=square
141
+ linejoin = 0 ; 0=mitered, 1=round, 2=bevel
142
+ miter_limit = 3.0 ; larger values mean longer spikes
143
+ ; 1=none, 1.415=90deg, 2=60deg, 10=11deg etc.
144
+
145
+ ; Specify the mapping of MicroStation line weights to line thickness on paper.
146
+ ; Units are MM, IN, or DOTS (the default)
147
+
148
+ weight_strokes(mm)=(0.250, 0.375, 0.500, 0.625, 0.750, 0.875, 1.000, 1.125, \
149
+ 1.250, 1.375, 1.500, 1.625, 1.750, 1.875, 2.000, 2.125, \
150
+ 2.250, 2.375, 2.500, 2.625, 2.750, 2.875, 3.000, 3.125, \
151
+ 3.250, 3.375, 3.500, 3.625, 3.750, 3.875, 4.000, 4.125)
152
+
153
+
154
+
155
+ ; The following options control raster plotting.
156
+ isv_raster=1 ; Plots the raster image, 1=On 0=Off Default=1
157
+ pixel_resolution=300 ; Resolution of pixels on output (dpi) Default=300
158
+ contrast=50 ; Contrast in percent, between 0-100 Default=50
159
+ brightness=50 ; Brightness in percent, between 0-100 Default=50
160
+ raster_fence=1 ; Clip the raster to fence, 1=On 0=Off Default=1
161
+ grayscale=0 ; Plot in gray scale, 1=On 0=Off Default=0
162
+ no_dgnraster=0 ; MS plot of 87/88, 1=Don't plot 0=Plot Default=0
163
+ background = 0 ; 0=white,1=black,2=color Default=0
164
+ no_rasterref=0 ; MS plot of 90's, 1=Don't plot 0=Plot Default=0