microstation 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.autotest +23 -0
  2. data/.gemtest +0 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +17 -0
  5. data/History.txt +6 -0
  6. data/Manifest.txt +60 -0
  7. data/README.txt +75 -0
  8. data/Rakefile +30 -0
  9. data/bin/dgn2pdf +37 -0
  10. data/lib/microstation.rb +88 -0
  11. data/lib/microstation/app.rb +286 -0
  12. data/lib/microstation/attributes.rb +35 -0
  13. data/lib/microstation/cad_input_queue.rb +25 -0
  14. data/lib/microstation/configuration.rb +57 -0
  15. data/lib/microstation/dir.rb +252 -0
  16. data/lib/microstation/drawing.rb +189 -0
  17. data/lib/microstation/enumerator.rb +29 -0
  18. data/lib/microstation/ext/pathname.rb +25 -0
  19. data/lib/microstation/extensions/hash.rb +27 -0
  20. data/lib/microstation/pdf_support.rb +40 -0
  21. data/lib/microstation/properties.rb +57 -0
  22. data/lib/microstation/scan/color.rb +38 -0
  23. data/lib/microstation/scan/criteria.rb +85 -0
  24. data/lib/microstation/scan/klass.rb +43 -0
  25. data/lib/microstation/scan/level.rb +38 -0
  26. data/lib/microstation/scan/line_style.rb +45 -0
  27. data/lib/microstation/scan/line_weight.rb +33 -0
  28. data/lib/microstation/scan/subtype.rb +40 -0
  29. data/lib/microstation/scan/type.rb +109 -0
  30. data/lib/microstation/scanner.rb +24 -0
  31. data/lib/microstation/tag.rb +58 -0
  32. data/lib/microstation/tag_set.rb +280 -0
  33. data/lib/microstation/template.rb +84 -0
  34. data/lib/microstation/text.rb +54 -0
  35. data/lib/microstation/text_node.rb +74 -0
  36. data/lib/microstation/ts/attribute.rb +139 -0
  37. data/lib/microstation/ts/instance.rb +112 -0
  38. data/lib/microstation/types.rb +91 -0
  39. data/lib/microstation/wrap.rb +214 -0
  40. data/plot/pdf-bw.plt +164 -0
  41. data/plot/pdf.plt +163 -0
  42. data/plot/png.plt +383 -0
  43. data/plot/tiff.plt +384 -0
  44. data/plot/wmbw.tbl +66 -0
  45. data/plot/wmcolor.tbl +62 -0
  46. data/spec/app_spec.rb +267 -0
  47. data/spec/configuration_spec.rb +122 -0
  48. data/spec/drawing_spec.rb +247 -0
  49. data/spec/drawings/new_drawing.dgn +0 -0
  50. data/spec/drawings/test.dgn +0 -0
  51. data/spec/drawings/test1.dgn +0 -0
  52. data/spec/drawings/testfile.pdf +0 -0
  53. data/spec/enumerator_spec.rb +60 -0
  54. data/spec/microstation_spec.rb +36 -0
  55. data/spec/scanner_spec.rb +155 -0
  56. data/spec/spec_app.rb +11 -0
  57. data/spec/spec_helper.rb +31 -0
  58. data/spec/tag_set_spec.rb +123 -0
  59. data/spec/text_node_spec.rb +92 -0
  60. data/spec/text_spec.rb +62 -0
  61. metadata +241 -0
@@ -0,0 +1,384 @@
1
+ ;----------------------------------------------------------------------
2
+ ;
3
+ ; Tagged Image File Format (TIFF) Output File Plotter Configuration file
4
+ ;
5
+ ; Current Revision:
6
+ ; $RCSfile: tiff.plt,v $
7
+ ; $Revision: 7.12.4.6 $ $Date: 2004/02/06 20:55:47 $
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
+
35
+ num_pens = 255 ; required record, must precede any "pen" records.
36
+ change_pen = both ; options are color, weight, level or both
37
+ model = MDL ; plotter model number
38
+ driver = lorip ; MDL driver to use
39
+ autocenter ; Automatically center plot on page
40
+
41
+ ; Refer to the documentation for available border qualifiers.
42
+ ; Note that only the border outline is supported in this driver.
43
+ ;border
44
+
45
+ default_extension = 'tif' ; default extension for plotfiles
46
+ ;
47
+ ; To configure a default output file name comment out the default_extension
48
+ ; line above and uncomment this line. "c:\tmp\color256.tif" may be substituted
49
+ ; with any desired filename - e.g. "$(MS_PLTFILES)plotfile.000"
50
+ ;
51
+ ;default_outFile/auto_overwrite = "c:\tmp\color256.tif"
52
+
53
+ size=(100,100)/off=(0,0)/name=max ; Mandatory form name for Publisher
54
+ size=(80,64)/off=(0,0)/name=1280x1024 ; leave room for border and border text
55
+ size=(64,48)/off=(0,0)/name=1024x768 ; leave room for border and border text
56
+ size=(50,37.5)/off=(0,0)/name=800x600 ; leave room for border and border text
57
+ size=(40,30)/off=(0,0)/name=640x480 ; leave room for border and border text
58
+ resolution(IN)=(0.0625, 0.0625) ; 50 inches / 800 dots == 16 dpi
59
+
60
+ ; Substitute the name of a pentable file to be loaded when this driver is selected
61
+ ;pentable=\dir\file.tbl
62
+
63
+ ; Stroke_tolerance determines tolerance for arcs and circles. Value is
64
+ ; between 0 and 10 with 10 being the tightest tolerance. Larger values
65
+ ; also create larger plot files.
66
+ stroke_tolerance=10
67
+
68
+ ;
69
+ ; Pen 0 is the 'background' pen. Other pens get their color by default from
70
+ ; the corresponding color in the current design file color table. The background
71
+ ; pen instead defaults to white. To have the background pen get it's value from
72
+ ; the master file color table, we assign it an RGB of(-1, -1, -1).
73
+ ;
74
+ pen(0)=/rgb=(-1, -1, -1) ; get background pen color from master file background color
75
+
76
+ ; Format = 3 tells the lorip driver to generate a TIFF file.
77
+ ; Quality identifies the type of compression
78
+ quality=1 ; Default compression
79
+ raster_compression/format=3/methods=(0)
80
+
81
+ ; The style records define how the design file line codes (styles)
82
+ ; are to be plotted. Values are in plotter units (units of device resolution).
83
+ ; Values determine pen down/up movements, where (10,28) for a dot
84
+ ; pattern leaves the pen down for 10 units and up for 28 units. The
85
+ ; /nohardware switch causes software stroking with these values.
86
+
87
+ style(1)=(1, 6) /nohardware ;style = dot
88
+ style(2)=(6, 4) /nohardware ;style = med dash
89
+ style(3)=(10, 4) /nohardware ;style = long dash
90
+ style(4)=(8, 4, 1, 4) /nohardware ;style = dot-dash
91
+ style(5)=(3, 4) /nohardware ;style = short dash
92
+ style(6)=(1, 4, 7, 4, 1, 4) /nohardware ;style = dash-dot-dot
93
+ style(7)=(9, 4, 3, 4) /nohardware ;style = long dash - short dash
94
+
95
+ ; The weight line determines the number of strokes to use with each weight.
96
+ ; The first position defines weight 0, second weight 1, third weight 2 and
97
+ ; so on up to weight 31. To increase or decrease the number of plotter units per
98
+ ; weight, change the number in that position.
99
+
100
+ weight_strokes=(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16)
101
+
102
+ ; Construction/active points are plotted by default. Comment out the next line
103
+ ; if you do not want points plotted.
104
+ point_size = .35
105
+
106
+ largest_polygon=20000
107
+
108
+ ; The pen_width record determines how far the pen moves when drawing
109
+ ; thick lines (weights) or when used to fill elements. Since this is
110
+ ; a rasterizing plotter driver, we want to move the pen 1 plotter coordinate
111
+ ; (1 pixel).
112
+ pen_width(1)=1
113
+ pen_width(2)=1
114
+ pen_width(3)=1
115
+ pen_width(4)=1
116
+ pen_width(5)=1
117
+ pen_width(6)=1
118
+ pen_width(7)=1
119
+ pen_width(8)=1
120
+ pen_width(9)=1
121
+ pen_width(10)=1
122
+ pen_width(11)=1
123
+ pen_width(12)=1
124
+ pen_width(13)=1
125
+ pen_width(14)=1
126
+ pen_width(15)=1
127
+ pen_width(16)=1
128
+ pen_width(17)=1
129
+ pen_width(18)=1
130
+ pen_width(19)=1
131
+ pen_width(20)=1
132
+ pen_width(21)=1
133
+ pen_width(22)=1
134
+ pen_width(23)=1
135
+ pen_width(24)=1
136
+ pen_width(25)=1
137
+ pen_width(26)=1
138
+ pen_width(27)=1
139
+ pen_width(28)=1
140
+ pen_width(29)=1
141
+ pen_width(30)=1
142
+ pen_width(31)=1
143
+ pen_width(32)=1
144
+ pen_width(33)=1
145
+ pen_width(34)=1
146
+ pen_width(35)=1
147
+ pen_width(36)=1
148
+ pen_width(37)=1
149
+ pen_width(38)=1
150
+ pen_width(39)=1
151
+ pen_width(40)=1
152
+ pen_width(41)=1
153
+ pen_width(42)=1
154
+ pen_width(43)=1
155
+ pen_width(44)=1
156
+ pen_width(45)=1
157
+ pen_width(46)=1
158
+ pen_width(47)=1
159
+ pen_width(48)=1
160
+ pen_width(49)=1
161
+ pen_width(50)=1
162
+ pen_width(51)=1
163
+ pen_width(52)=1
164
+ pen_width(53)=1
165
+ pen_width(54)=1
166
+ pen_width(55)=1
167
+ pen_width(56)=1
168
+ pen_width(57)=1
169
+ pen_width(58)=1
170
+ pen_width(59)=1
171
+ pen_width(60)=1
172
+ pen_width(61)=1
173
+ pen_width(62)=1
174
+ pen_width(63)=1
175
+ pen_width(64)=1
176
+ pen_width(65)=1
177
+ pen_width(66)=1
178
+ pen_width(67)=1
179
+ pen_width(68)=1
180
+ pen_width(69)=1
181
+ pen_width(70)=1
182
+ pen_width(71)=1
183
+ pen_width(72)=1
184
+ pen_width(73)=1
185
+ pen_width(74)=1
186
+ pen_width(75)=1
187
+ pen_width(76)=1
188
+ pen_width(77)=1
189
+ pen_width(78)=1
190
+ pen_width(79)=1
191
+ pen_width(80)=1
192
+ pen_width(81)=1
193
+ pen_width(82)=1
194
+ pen_width(83)=1
195
+ pen_width(84)=1
196
+ pen_width(85)=1
197
+ pen_width(86)=1
198
+ pen_width(87)=1
199
+ pen_width(88)=1
200
+ pen_width(89)=1
201
+ pen_width(90)=1
202
+ pen_width(91)=1
203
+ pen_width(92)=1
204
+ pen_width(93)=1
205
+ pen_width(94)=1
206
+ pen_width(95)=1
207
+ pen_width(96)=1
208
+ pen_width(97)=1
209
+ pen_width(98)=1
210
+ pen_width(99)=1
211
+ pen_width(100)=1
212
+ pen_width(101)=1
213
+ pen_width(102)=1
214
+ pen_width(103)=1
215
+ pen_width(104)=1
216
+ pen_width(105)=1
217
+ pen_width(106)=1
218
+ pen_width(107)=1
219
+ pen_width(108)=1
220
+ pen_width(109)=1
221
+ pen_width(110)=1
222
+ pen_width(111)=1
223
+ pen_width(112)=1
224
+ pen_width(113)=1
225
+ pen_width(114)=1
226
+ pen_width(115)=1
227
+ pen_width(116)=1
228
+ pen_width(117)=1
229
+ pen_width(118)=1
230
+ pen_width(119)=1
231
+ pen_width(120)=1
232
+ pen_width(121)=1
233
+ pen_width(122)=1
234
+ pen_width(123)=1
235
+ pen_width(124)=1
236
+ pen_width(125)=1
237
+ pen_width(126)=1
238
+ pen_width(127)=1
239
+ pen_width(128)=1
240
+ pen_width(129)=1
241
+ pen_width(130)=1
242
+ pen_width(131)=1
243
+ pen_width(132)=1
244
+ pen_width(133)=1
245
+ pen_width(134)=1
246
+ pen_width(135)=1
247
+ pen_width(136)=1
248
+ pen_width(137)=1
249
+ pen_width(138)=1
250
+ pen_width(139)=1
251
+ pen_width(140)=1
252
+ pen_width(141)=1
253
+ pen_width(142)=1
254
+ pen_width(143)=1
255
+ pen_width(144)=1
256
+ pen_width(145)=1
257
+ pen_width(146)=1
258
+ pen_width(147)=1
259
+ pen_width(148)=1
260
+ pen_width(149)=1
261
+ pen_width(150)=1
262
+ pen_width(151)=1
263
+ pen_width(152)=1
264
+ pen_width(153)=1
265
+ pen_width(154)=1
266
+ pen_width(155)=1
267
+ pen_width(156)=1
268
+ pen_width(157)=1
269
+ pen_width(158)=1
270
+ pen_width(159)=1
271
+ pen_width(160)=1
272
+ pen_width(161)=1
273
+ pen_width(162)=1
274
+ pen_width(163)=1
275
+ pen_width(164)=1
276
+ pen_width(165)=1
277
+ pen_width(166)=1
278
+ pen_width(167)=1
279
+ pen_width(168)=1
280
+ pen_width(169)=1
281
+ pen_width(170)=1
282
+ pen_width(171)=1
283
+ pen_width(172)=1
284
+ pen_width(173)=1
285
+ pen_width(174)=1
286
+ pen_width(175)=1
287
+ pen_width(176)=1
288
+ pen_width(177)=1
289
+ pen_width(178)=1
290
+ pen_width(179)=1
291
+ pen_width(180)=1
292
+ pen_width(181)=1
293
+ pen_width(182)=1
294
+ pen_width(183)=1
295
+ pen_width(184)=1
296
+ pen_width(185)=1
297
+ pen_width(186)=1
298
+ pen_width(187)=1
299
+ pen_width(188)=1
300
+ pen_width(189)=1
301
+ pen_width(190)=1
302
+ pen_width(191)=1
303
+ pen_width(192)=1
304
+ pen_width(193)=1
305
+ pen_width(194)=1
306
+ pen_width(195)=1
307
+ pen_width(196)=1
308
+ pen_width(197)=1
309
+ pen_width(198)=1
310
+ pen_width(199)=1
311
+ pen_width(200)=1
312
+ pen_width(201)=1
313
+ pen_width(202)=1
314
+ pen_width(203)=1
315
+ pen_width(204)=1
316
+ pen_width(205)=1
317
+ pen_width(206)=1
318
+ pen_width(207)=1
319
+ pen_width(208)=1
320
+ pen_width(209)=1
321
+ pen_width(210)=1
322
+ pen_width(211)=1
323
+ pen_width(212)=1
324
+ pen_width(213)=1
325
+ pen_width(214)=1
326
+ pen_width(215)=1
327
+ pen_width(216)=1
328
+ pen_width(217)=1
329
+ pen_width(218)=1
330
+ pen_width(219)=1
331
+ pen_width(220)=1
332
+ pen_width(221)=1
333
+ pen_width(222)=1
334
+ pen_width(223)=1
335
+ pen_width(224)=1
336
+ pen_width(225)=1
337
+ pen_width(226)=1
338
+ pen_width(227)=1
339
+ pen_width(228)=1
340
+ pen_width(229)=1
341
+ pen_width(230)=1
342
+ pen_width(231)=1
343
+ pen_width(232)=1
344
+ pen_width(233)=1
345
+ pen_width(234)=1
346
+ pen_width(235)=1
347
+ pen_width(236)=1
348
+ pen_width(237)=1
349
+ pen_width(238)=1
350
+ pen_width(239)=1
351
+ pen_width(240)=1
352
+ pen_width(241)=1
353
+ pen_width(242)=1
354
+ pen_width(243)=1
355
+ pen_width(244)=1
356
+ pen_width(245)=1
357
+ pen_width(246)=1
358
+ pen_width(247)=1
359
+ pen_width(248)=1
360
+ pen_width(249)=1
361
+ pen_width(250)=1
362
+ pen_width(251)=1
363
+ pen_width(252)=1
364
+ pen_width(253)=1
365
+ pen_width(254)=1
366
+ pen_width(255)=1
367
+
368
+
369
+ ; The following options control printing of Raster Manager images.
370
+ ; Refer to the "Printing Using Raster Manager" section of the documentation
371
+ ; for descriptions of these records.
372
+
373
+ software_raster/resolution=16/background=black
374
+
375
+ PIXEL_RESOLUTION = 16
376
+ GRAYSCALE = 0
377
+ BACKGROUND = 2
378
+ CONTRAST = 50
379
+ BRIGHTNESS = 50
380
+ NO_RASTERREF = 0
381
+
382
+ ; The following record specifies whether type 87/88 raster elements are printed.
383
+ ; This record is ignored by Raster Manager.
384
+ NO_DGNRASTER = 0 ; 0=plot, 1=don't plot (the default is to plot).
@@ -0,0 +1,66 @@
1
+ # Q:\Bentley\WorkspaceXM\Standards\tables\pen\wmbw.tbl
2
+
3
+ BEGIN_GLOBAL
4
+ VERSION = 890
5
+ PLOTTING
6
+ VIEWS = 1-8
7
+ SYMBOLOGY = AsStored
8
+ EXPLODE_SHARED_CELLS = 1
9
+ EXPLODE_DIMENSIONS = 0
10
+ EXPLODE_MULTILINES = 0
11
+ EXPLODE_TAGS = 1
12
+ MATCH_MULTIPLE_SECTIONS = 0
13
+ PST_COMPATIBLE_MODE = 0
14
+ SORT_EXPORTED_GRAPHICS = 0
15
+ END_GLOBAL
16
+
17
+ BEGIN Watermark
18
+ TYPE = 17
19
+ BASICFUNC = watermark.ba,setwatermarkbw
20
+ END
21
+
22
+ BEGIN BW
23
+ OUT_COLOR = 0
24
+ END
25
+
26
+ BEGIN_STRINGS
27
+ "$FILES$" = "_FILES_"
28
+ "$DATE$" = "_DATE_"
29
+ "$TIME$" = "_TIME_"
30
+ "$NAME$" = "$(_USTN_USERNAME)"
31
+ END_STRINGS
32
+
33
+ BEGIN_WEIGHTMAP
34
+ 0 = 4 0.15
35
+ 1 = 4 0.3
36
+ 2 = 4 0.475
37
+ 3 = 4 0.65
38
+ 4 = 4 0.7
39
+ 5 = 4 0.825
40
+ 6 = 4 0
41
+ 7 = 4 0
42
+ 8 = 4 1.4
43
+ 9 = 4 1.4
44
+ 10 = 4 1.4
45
+ 11 = 4 2
46
+ 12 = 4 2
47
+ 13 = 4 2
48
+ 14 = 4 2
49
+ 15 = 4 2
50
+ 16 = 4 3.4
51
+ 17 = 4 3.6
52
+ 18 = 4 3.8
53
+ 19 = 4 4
54
+ 20 = 4 4.2
55
+ 21 = 4 4.4
56
+ 22 = 4 4.55
57
+ 23 = 4 0
58
+ 24 = 4 0
59
+ 25 = 4 0
60
+ 26 = 4 0
61
+ 27 = 4 0
62
+ 28 = 4 0
63
+ 29 = 4 0
64
+ 30 = 4 0
65
+ 31 = 4 0
66
+ END_WEIGHTMAP
@@ -0,0 +1,62 @@
1
+ # Q:\Bentley\WorkspaceXM\Standards\tables\pen\wmcolor.tbl
2
+
3
+ BEGIN_GLOBAL
4
+ VERSION = 890
5
+ PLOTTING
6
+ VIEWS = 1-8
7
+ SYMBOLOGY = AsStored
8
+ EXPLODE_SHARED_CELLS = 1
9
+ EXPLODE_DIMENSIONS = 0
10
+ EXPLODE_MULTILINES = 0
11
+ EXPLODE_TAGS = 1
12
+ MATCH_MULTIPLE_SECTIONS = 0
13
+ PST_COMPATIBLE_MODE = 0
14
+ SORT_EXPORTED_GRAPHICS = 0
15
+ END_GLOBAL
16
+
17
+ BEGIN Watermark
18
+ TYPE = 17
19
+ BASICFUNC = watermark.ba,setwatermark
20
+ END
21
+
22
+ BEGIN_STRINGS
23
+ "$FILES$" = "_FILES_"
24
+ "$DATE$" = "_DATE_"
25
+ "$TIME$" = "_TIME_"
26
+ "$NAME$" = "$(_USTN_USERNAME)"
27
+ END_STRINGS
28
+
29
+ BEGIN_WEIGHTMAP
30
+ 0 = 4 0.15
31
+ 1 = 4 0.3
32
+ 2 = 4 0.475
33
+ 3 = 4 0.65
34
+ 4 = 4 0.7
35
+ 5 = 4 0.825
36
+ 6 = 4 0
37
+ 7 = 4 0
38
+ 8 = 4 1.4
39
+ 9 = 4 1.4
40
+ 10 = 4 1.4
41
+ 11 = 4 2
42
+ 12 = 4 2
43
+ 13 = 4 2
44
+ 14 = 4 2
45
+ 15 = 4 2
46
+ 16 = 4 3.4
47
+ 17 = 4 3.6
48
+ 18 = 4 3.8
49
+ 19 = 4 4
50
+ 20 = 4 4.2
51
+ 21 = 4 4.4
52
+ 22 = 4 4.55
53
+ 23 = 4 0
54
+ 24 = 4 0
55
+ 25 = 4 0
56
+ 26 = 4 0
57
+ 27 = 4 0
58
+ 28 = 4 0
59
+ 29 = 4 0
60
+ 30 = 4 0
61
+ 31 = 4 0
62
+ END_WEIGHTMAP