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/bin/dgn_template ADDED
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ $LOAD_PATH.unshift(File.join(__dir__, 'lib'))
4
+
5
+ begin # XXX: Remove this begin/rescue before distributing your app
6
+ require 'microstation'
7
+ rescue LoadError
8
+ STDERR.puts "In development, you need to use `bundle exec ruby -I lib bin/dgn_template` to run your app"
9
+ STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
10
+ STDERR.puts "Feel free to remove this message from bin/dgn_template now"
11
+ exit 64
12
+ end
13
+
14
+
15
+ module Cli
16
+ include GLI::App
17
+
18
+ extend self
19
+
20
+ program_desc "Create drawings from dgn templates and yaml files describing changes"
21
+
22
+ version Microstation::VERSION
23
+
24
+ subcommand_option_handling :normal
25
+ arguments :strict
26
+
27
+ # desc 'Describe some switch here'
28
+ # switch [:s,:switch]
29
+
30
+ # desc 'Describe some flag here'
31
+ # default_value 'the default'
32
+ # arg_name 'The name of the argument'
33
+ # flag [:f,:flagname]
34
+
35
+ desc 'create template description files to fill out'
36
+ long_desc "
37
+ Given a directory, this will generate yaml files describing
38
+ the fields and tagsets of dgn files in the directory
39
+ "
40
+
41
+ arg 'dir'
42
+ command :dump do |c|
43
+ # c.desc ''
44
+ # c.switch :s
45
+
46
+ c.desc 'file to run dump on'
47
+ # c.default_value 'default'
48
+ c.flag [:f, :filename]
49
+ c.action do |global_options,options,args|
50
+
51
+ # Your command logic here
52
+
53
+ # If you have any errors, just raise them
54
+ # raise "that command made no sense"
55
+ if file=options[:f]
56
+ puts "file dump ran with file option #{options[:f]}"
57
+
58
+ Microstation.dump_template_info(file, visible: true)
59
+ else
60
+ help_now!('dir is required') if args.empty?
61
+ Microstation.dump_template_info_for_dir args.first
62
+ end
63
+ end
64
+ end
65
+
66
+ desc 'Run the template description files'
67
+ arg :dir, :optional
68
+ command :run do |c|
69
+
70
+ c.desc 'file to run'
71
+ c.flag [:f, :filename]
72
+ c.action do |global_options,options,args|
73
+ if options[:f]
74
+ puts "Running run on file #{options[:f]}"
75
+
76
+ else
77
+ dir = args.shift
78
+ help_now!('arg "dir" is required if no :filename flag set') unless dir
79
+ Microstation.run_templates_in_dir(dir)
80
+ end
81
+ end
82
+ end
83
+
84
+ pre do |global,command,options,args|
85
+ # Pre logic here
86
+ # Return true to proceed; false to abort and not call the
87
+ # chosen command
88
+ # Use skips_pre before a command to skip this block
89
+ # on that command only
90
+ true
91
+ end
92
+
93
+ post do |global,command,options,args|
94
+ # Post logic here
95
+ # Use skips_post before a command to skip this
96
+ # block on that command only
97
+ end
98
+
99
+ on_error do |exception|
100
+ # Error logic here
101
+ # return false to skip default error handling
102
+ true
103
+ end
104
+
105
+ exit run(ARGV)
106
+
107
+ end
data/bin/pw_print ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require 'methadone'
4
+
5
+ require 'microstation'
6
+ require 'microstation/extensions/faa'
7
+ require 'pry'
8
+
9
+ class PwApp
10
+ include Methadone::Main
11
+ include Methadone::CLILogging
12
+
13
+ main do
14
+ directory_path = Pathname( options['save-dir']).expand_path
15
+ exit_now! "arg directory: #{directory_path} doesn't exist" unless directory_path.directory?
16
+
17
+
18
+ app =Microstation.save_current_drawing(directory_path,exit: options['exit'])
19
+ binding.pry unless options['exit']
20
+
21
+
22
+ end
23
+
24
+ description "Save the currently open projectwise drawing"
25
+
26
+ options['save-dir'] = Pathname.getwd
27
+ options['exit'] = true
28
+ on("-d DIR", "--save-dir", "Set the location of the save dir")
29
+ on("-e", "--[no-]exit",TrueClass, "Close the Microstation instance")
30
+
31
+ version Microstation::VERSION
32
+
33
+ use_log_level_option
34
+ go!
35
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file