autocad 0.4.6 → 0.5

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop/minitest.yml +2 -2
  3. data/.rubocop/strict.yml +4 -4
  4. data/.rubocop.yml +36 -33
  5. data/CHANGELOG.md +5 -5
  6. data/LICENSE.txt +21 -21
  7. data/README.md +134 -39
  8. data/Rakefile +26 -10
  9. data/exe/autocad +3 -3
  10. data/gemfiles/rubocop.gemfile +2 -1
  11. data/lib/autocad/app.rb +127 -28
  12. data/lib/autocad/arc.rb +3 -0
  13. data/lib/autocad/block.rb +11 -6
  14. data/lib/autocad/block_reference.rb +33 -4
  15. data/lib/autocad/bounding_box.rb +202 -0
  16. data/lib/autocad/dim_style.rb +4 -0
  17. data/lib/autocad/drawing.rb +873 -172
  18. data/lib/autocad/element.rb +217 -25
  19. data/lib/autocad/errors.rb +9 -0
  20. data/lib/autocad/filter.rb +502 -168
  21. data/lib/autocad/layer.rb +129 -41
  22. data/lib/autocad/layout.rb +120 -0
  23. data/lib/autocad/line.rb +154 -55
  24. data/lib/autocad/message_box.rb +95 -95
  25. data/lib/autocad/model.rb +217 -89
  26. data/lib/autocad/mtext.rb +189 -110
  27. data/lib/autocad/plot.rb +45 -0
  28. data/lib/autocad/plot_configuration.rb +372 -0
  29. data/lib/autocad/point.rb +7 -0
  30. data/lib/autocad/point3d.rb +18 -11
  31. data/lib/autocad/pviewport.rb +136 -21
  32. data/lib/autocad/selection_filter.rb +358 -180
  33. data/lib/autocad/selection_set.rb +140 -61
  34. data/lib/autocad/selection_set_adapter.rb +187 -8
  35. data/lib/autocad/spline.rb +27 -0
  36. data/lib/autocad/text.rb +66 -11
  37. data/lib/autocad/text_style.rb +4 -0
  38. data/lib/autocad/version.rb +1 -1
  39. data/lib/autocad/viewport.rb +57 -0
  40. data/lib/autocad.rb +126 -30
  41. data/lib/faa/cleanup.rb +137 -0
  42. data/lib/win32ole_helper.rb +52 -0
  43. data/rbs_collection.lock.yaml +38 -18
  44. data/sig/generated/autocad/app.rbs +278 -251
  45. data/sig/generated/autocad/arc.rbs +6 -3
  46. data/sig/generated/autocad/block.rbs +8 -5
  47. data/sig/generated/autocad/block_reference.rbs +99 -59
  48. data/sig/generated/autocad/bounding_box.rbs +78 -0
  49. data/sig/generated/autocad/dim_style.rbs +6 -0
  50. data/sig/generated/autocad/drawing.rbs +597 -158
  51. data/sig/generated/autocad/element.rbs +233 -166
  52. data/sig/generated/autocad/errors.rbs +29 -23
  53. data/sig/generated/autocad/filter.rbs +388 -60
  54. data/sig/generated/autocad/layer.rbs +76 -19
  55. data/sig/generated/autocad/layout.rbs +64 -0
  56. data/sig/generated/autocad/line.rbs +128 -25
  57. data/sig/generated/autocad/message_box.rbs +81 -81
  58. data/sig/generated/autocad/model.rbs +115 -41
  59. data/sig/generated/autocad/mtext.rbs +123 -0
  60. data/sig/generated/autocad/plot.rbs +26 -0
  61. data/sig/generated/autocad/plot_configuration.rbs +176 -0
  62. data/sig/generated/autocad/point.rbs +7 -0
  63. data/sig/generated/autocad/point3d.rbs +70 -66
  64. data/sig/generated/autocad/pviewport.rbs +64 -0
  65. data/sig/generated/autocad/selection_filter.rbs +226 -50
  66. data/sig/generated/autocad/selection_set.rbs +112 -37
  67. data/sig/generated/autocad/selection_set_adapter.rbs +235 -28
  68. data/sig/generated/autocad/spline.rbs +22 -0
  69. data/sig/generated/autocad/text.rbs +66 -7
  70. data/sig/generated/autocad/text_style.rbs +6 -0
  71. data/sig/generated/autocad/viewport.rbs +19 -2
  72. data/sig/generated/autocad.rbs +140 -68
  73. data/sig/generated/faa/cleanup.rbs +53 -0
  74. data/sig/generated/win32ole_helper.rbs +9 -0
  75. data/sig/prototype/lib/autocad/app.rbs +3 -1
  76. data/sig/prototype/lib/autocad/bounding_box.rbs +15 -0
  77. data/sig/prototype/lib/autocad/drawing.rbs +6 -0
  78. data/sig/prototype/lib/autocad/layer.rbs +5 -0
  79. data/sig/prototype/lib/autocad/viewport.rbs +7 -0
  80. data/sig/prototype/lib/autocad.rbs +1 -1
  81. metadata +29 -5
  82. data/event_handler.log +0 -24
  83. data/sig/generated/autocad/text_node.rbs +0 -37
@@ -1,37 +1,112 @@
1
- # Generated from lib/autocad/selection_set.rb with RBS::Inline
2
-
3
- module Autocad
4
- class SelectionSet
5
- attr_reader filter_types: untyped
6
-
7
- attr_reader filter_values: untyped
8
-
9
- attr_reader name: untyped
10
-
11
- def initialize: (untyped name) -> untyped
12
-
13
- def has_filter?: () -> untyped
14
-
15
- def filter_text: (?untyped str) -> untyped
16
-
17
- def to_ole_filter_type: () -> untyped
18
-
19
- def to_ole_filter_value: () -> untyped
20
-
21
- # filter do |f|
22
- # st = f.type('Circle').or(f.type('Arc'))
23
- # st2 = f.layer('0').or(f.layer('1'))
24
- # f.and(st, st2)
25
- # end
26
- def filter: () -> untyped
27
-
28
- # Helper methods for common operations
29
- def filter_by_type: (*untyped types) -> untyped
30
-
31
- def filter_by_layer: (*untyped layers) -> untyped
32
-
33
- def filter_text_containing: (untyped text) -> untyped
34
-
35
- def filter_block_references: (?untyped name) -> untyped
36
- end
37
- end
1
+ # Generated from lib/autocad/selection_set.rb with RBS::Inline
2
+
3
+ module Autocad
4
+ # Manages named selection criteria for AutoCAD entities
5
+ #
6
+ # Stores filter criteria for entity selection without executing the selection.
7
+ # Works with SelectionSetAdapter to apply filters and retrieve entities.
8
+ #
9
+ # @example Create a selection set with complex filters
10
+ # ss = SelectionSet.new("walls")
11
+ # ss.filter do |f|
12
+ # f.and(f.layer("WALLS"), f.or(f.type("LINE"), f.type("POLYLINE")))
13
+ # end
14
+ class SelectionSet
15
+ # @rbs attr_reader name: String -- Unique identifier for the selection set
16
+ # @rbs attr_reader filter_types: Array[Integer] -- AutoCAD group codes (DXF codes)
17
+ # @rbs attr_reader filter_values: Array[untyped] -- Filter values matching group codes
18
+ attr_reader filter_types: untyped
19
+
20
+ # @rbs attr_reader name: String -- Unique identifier for the selection set
21
+ # @rbs attr_reader filter_types: Array[Integer] -- AutoCAD group codes (DXF codes)
22
+ # @rbs attr_reader filter_values: Array[untyped] -- Filter values matching group codes
23
+ attr_reader filter_values: untyped
24
+
25
+ # @rbs attr_reader name: String -- Unique identifier for the selection set
26
+ # @rbs attr_reader filter_types: Array[Integer] -- AutoCAD group codes (DXF codes)
27
+ # @rbs attr_reader filter_values: Array[untyped] -- Filter values matching group codes
28
+ attr_reader name: untyped
29
+
30
+ # Initialize a new selection set with a name
31
+ # @param name [String] Unique identifier for the selection set
32
+ # @rbs name: String
33
+ # @rbs return void
34
+ def initialize: (String name) -> void
35
+
36
+ # Check if set has active filters
37
+ # @return [Boolean] True if filters are defined
38
+ # @rbs return bool
39
+ def has_filter?: () -> bool
40
+
41
+ # Filter for text entities with optional content matching
42
+ # @param str [String, nil] Optional text pattern to match
43
+ # @return [self] The selection set for chaining
44
+ # @example Filter all text entities
45
+ # ss.filter_text
46
+ # @example Filter text with specific content
47
+ # ss.filter_text("Revision")
48
+ # @rbs str: String? -- Optional text pattern to match
49
+ # @rbs return self
50
+ def filter_text: (?String? str) -> self
51
+
52
+ # Configure complex filters through block
53
+ # @yield [Filter] Block for building filter criteria
54
+ # @return [self] The selection set for chaining
55
+ # @example Create a filter for red circles
56
+ # ss.filter do |f|
57
+ # f.and(f.type("CIRCLE"), f.color(1))
58
+ # end
59
+ # @example Combine multiple conditions
60
+ # ss.filter do |f|
61
+ # st = f.type('Circle').or(f.type('Arc'))
62
+ # st2 = f.layer('0').or(f.layer('1'))
63
+ # f.and(st, st2)
64
+ # end
65
+ # @rbs &: (Filter) -> Filter
66
+ # @rbs return self
67
+ def filter: () { (Filter) -> Filter } -> self
68
+
69
+ # Clear all filter criteria
70
+ # @return [self] The selection set for chaining
71
+ # @rbs return self
72
+ def clear_filter: () -> self
73
+
74
+ # Filter by entity types
75
+ # @param types [Array<String>] Entity type names (e.g., "LINE", "CIRCLE")
76
+ # @return [self] The selection set for chaining
77
+ # @example Filter for lines and polylines
78
+ # ss.filter_by_type("LINE", "POLYLINE")
79
+ # @rbs *types: Array[String]
80
+ # @rbs return self
81
+ def filter_by_type: (*Array[String] types) -> self
82
+
83
+ # Filter by layer names
84
+ # @param layers [Array<String>] Layer names to filter
85
+ # @return [self] The selection set for chaining
86
+ # @example Filter for entities on specific layers
87
+ # ss.filter_by_layer("WALLS", "DOORS")
88
+ # @rbs *layers: Array[String]
89
+ # @rbs return self
90
+ def filter_by_layer: (*Array[String] layers) -> self
91
+
92
+ # Filter text entities containing specific text
93
+ # @param text [String] Text pattern to search for (supports wildcards)
94
+ # @return [self] The selection set for chaining
95
+ # @example Find text containing "NOTE"
96
+ # ss.filter_text_containing("*NOTE*")
97
+ # @rbs text: String
98
+ # @rbs return self
99
+ def filter_text_containing: (String text) -> self
100
+
101
+ # Filter for block references with optional name
102
+ # @param name [String, nil] Optional block name to filter
103
+ # @return [self] The selection set for chaining
104
+ # @example Filter for any block reference
105
+ # ss.filter_block_references
106
+ # @example Filter for specific block
107
+ # ss.filter_block_references("DOOR")
108
+ # @rbs name: String?
109
+ # @rbs return self
110
+ def filter_block_references: (?String? name) -> self
111
+ end
112
+ end
@@ -1,28 +1,235 @@
1
- # Generated from lib/autocad/selection_set_adapter.rb with RBS::Inline
2
-
3
- module Autocad
4
- class SelectionSetAdapter
5
- def initialize: (untyped drawing, untyped selection_set) -> untyped
6
-
7
- def filter_types: () -> untyped
8
-
9
- def filter_values: () -> untyped
10
-
11
- def select_on_screen: () -> untyped
12
-
13
- # accepts Point3d | [x,y] | (x,y)
14
- def select_at_point: (untyped x, untyped y) -> untyped
15
-
16
- # @param points [Array<Point3d>] Array of points defining the polygon
17
- # @param mode [:fence, :window, :crossing] Selection mode
18
- def select_by_polygon: (?points: untyped, ?mode: untyped) -> untyped
19
-
20
- def filter: () ?{ (?) -> untyped } -> untyped
21
-
22
- private
23
-
24
- def create_selection_set: () -> untyped
25
-
26
- def create_ole_variant: (untyped data) -> untyped
27
- end
28
- end
1
+ # Generated from lib/autocad/selection_set_adapter.rb with RBS::Inline
2
+
3
+ module Autocad
4
+ # Manages AutoCAD selection set operations and OLE integration
5
+ #
6
+ # Executes selections using stored criteria and provides access to selected entities.
7
+ # Bridges between Ruby selection criteria and AutoCAD's native selection mechanisms.
8
+ #
9
+ # Key Features:
10
+ # - Multiple selection methods (window, crossing, fence, point)
11
+ # - Filter-based entity selection
12
+ # - Enumeration of selected entities
13
+ # - OLE integration with AutoCAD
14
+ #
15
+ # @example Create and use a selection set
16
+ # ss = drawing.create_selection_set("walls")
17
+ # ss.filter { |f| f.layer("WALLS") }
18
+ # ss.select(mode: :all)
19
+ # ss.each { |wall| wall.color = 1 }
20
+ class SelectionSetAdapter
21
+ # Initialize from OLE object
22
+ # @param drawing [Drawing] Parent drawing document
23
+ # @param ole [WIN32OLE] AutoCAD OLE selection set object
24
+ # @return [SelectionSetAdapter] New adapter instance
25
+ # @rbs drawing: Drawing
26
+ # @rbs ole: WIN32OLE
27
+ # @rbs return SelectionSetAdapter
28
+ def self.from_ole_obj: (Drawing drawing, WIN32OLE ole) -> SelectionSetAdapter
29
+
30
+ # @rbs attr_reader ole_obj: WIN32OLE -- Underlying OLE selection set
31
+ # @rbs attr_reader drawing: Drawing -- Parent drawing document
32
+ # @rbs attr_reader selection_set: SelectionSet -- Configured selection criteria
33
+ attr_reader ole_obj: untyped
34
+
35
+ # @rbs attr_reader ole_obj: WIN32OLE -- Underlying OLE selection set
36
+ # @rbs attr_reader drawing: Drawing -- Parent drawing document
37
+ # @rbs attr_reader selection_set: SelectionSet -- Configured selection criteria
38
+ attr_reader drawing: untyped
39
+
40
+ # @rbs attr_reader ole_obj: WIN32OLE -- Underlying OLE selection set
41
+ # @rbs attr_reader drawing: Drawing -- Parent drawing document
42
+ # @rbs attr_reader selection_set: SelectionSet -- Configured selection criteria
43
+ attr_reader selection_set: untyped
44
+
45
+ # Initialize new adapter
46
+ # @param drawing [Drawing] Parent drawing document
47
+ # @param selection_set [SelectionSet] Selection criteria container
48
+ # @param ole [WIN32OLE, nil] Optional existing OLE selection set
49
+ # @rbs drawing: Drawing
50
+ # @rbs selection_set: SelectionSet
51
+ # @rbs ole: WIN32OLE?
52
+ # @rbs return void
53
+ def initialize: (Drawing drawing, SelectionSet selection_set, ?WIN32OLE? ole) -> void
54
+
55
+ # Delete the selection set from AutoCAD
56
+ # @return [void]
57
+ # @example Remove selection set when no longer needed
58
+ # ss.delete if ss.count == 0
59
+ # @rbs return void
60
+ def delete: () -> void
61
+
62
+ # Checks if the selection set has any items
63
+ # @return [Boolean] True if selection contains entities
64
+ # @example Skip processing if selection is empty
65
+ # next unless ss.has_items?
66
+ # @rbs return bool
67
+ def has_items?: () -> bool
68
+
69
+ # Get item count in selection set
70
+ # @return [Integer] Number of selected entities
71
+ # @example Report selection count
72
+ # puts "Selected #{ss.count} entities"
73
+ # @rbs return Integer
74
+ def count: () -> Integer
75
+
76
+ # Clear selection set contents
77
+ # @return [void]
78
+ # @example Clear before new selection
79
+ # ss.clear
80
+ # ss.select_on_screen
81
+ # @rbs return void
82
+ def clear: () -> void
83
+
84
+ # Clear filter criteria
85
+ # @return [void]
86
+ # @example Reset filters for new selection
87
+ # ss.clear_filter
88
+ # ss.filter { |f| f.type("LINE") }
89
+ # @rbs return void
90
+ def clear_filter: () -> void
91
+
92
+ # Set text content filter
93
+ # @param str [String] Text pattern to match
94
+ # @return [void]
95
+ # @example Filter for text with specific content
96
+ # ss.filter_text("Revision")
97
+ # @rbs str: String -- Text pattern to match
98
+ # @rbs return void
99
+ def filter_text: (String str) -> void
100
+
101
+ # Filter text containing substring
102
+ # @param str [String] Substring to match
103
+ # @return [void]
104
+ # @example Find text containing "NOTE"
105
+ # ss.filter_text_containing("NOTE")
106
+ # @rbs str: String -- Substring to match
107
+ # @rbs return void
108
+ def filter_text_containing: (String str) -> void
109
+
110
+ # Get the application instance
111
+ # @return [Autocad::App] The application instance
112
+ # @private
113
+ def app: () -> untyped
114
+
115
+ # Iterate through selected entities
116
+ # @yield [Element] Block to process each entity
117
+ # @return [Enumerator<Element>] Enumerator of selected entities if no block given
118
+ # @example Process each selected entity
119
+ # ss.each { |entity| entity.color = 1 }
120
+ # @example Convert to array
121
+ # entities = ss.each.to_a
122
+ # @rbs &: (Element) -> void
123
+ # @rbs return Enumerator[Element]
124
+ def each: () { (Element) -> void } -> Enumerator[Element]
125
+
126
+ # Get the name of the selection set
127
+ # @return [String] The selection set name
128
+ # @example Get selection set identifier
129
+ # puts "Working with selection set: #{ss.name}"
130
+ # @rbs return String
131
+ def name: () -> String
132
+
133
+ # Get filter types from selection set
134
+ # @return [Array<Integer>] Array of DXF group codes
135
+ # @example Access raw filter data
136
+ # puts "Using filter types: #{ss.filter_types.join(', ')}"
137
+ # @rbs return Array[Integer]
138
+ def filter_types: () -> Array[Integer]
139
+
140
+ # Get filter values from selection set
141
+ # @return [Array<Object>] Array of filter values
142
+ # @example Access raw filter data
143
+ # puts "Using filter values: #{ss.filter_values.inspect}"
144
+ # @rbs return Array[untyped]
145
+ def filter_values: () -> Array[untyped]
146
+
147
+ # Select entities interactively on screen
148
+ # @param ft [WIN32OLE::Variant, nil] Optional filter types variant
149
+ # @param fv [WIN32OLE::Variant, nil] Optional filter values variant
150
+ # @return [void]
151
+ # @example Select entities with user interaction
152
+ # ss.select_on_screen
153
+ # @example Select with predefined filters
154
+ # ss.filter { |f| f.type("CIRCLE") }
155
+ # ss.select_on_screen
156
+ # @rbs ft: WIN32OLE::Variant? -- Filter types variant
157
+ # @rbs fv: WIN32OLE::Variant? -- Filter values variant
158
+ # @rbs return void
159
+ def select_on_screen: (?WIN32OLE::Variant? ft, ?WIN32OLE::Variant? fv) -> void
160
+
161
+ # Select entities using various methods
162
+ # @param mode [Symbol] Selection mode (:all, :window, :crossing, :previous, :last)
163
+ # @param pt1 [Point3d, nil] First point for window selection
164
+ # @param pt2 [Point3d, nil] Second point for window selection
165
+ # @param ft [WIN32OLE::Variant, nil] Optional filter types variant
166
+ # @param fv [WIN32OLE::Variant, nil] Optional filter values variant
167
+ # @return [void]
168
+ # @example Select all entities matching filter
169
+ # ss.select(mode: :all)
170
+ # @example Window selection
171
+ # ss.select(mode: :window, pt1: [0,0,0], pt2: [10,10,0])
172
+ # @rbs mode: Symbol -- Selection mode (:all, :window, :crossing, :previous, :last)
173
+ # @rbs pt1: Point3d? -- First point for window selection
174
+ # @rbs pt2: Point3d? -- Second point for window selection
175
+ # @rbs ft: WIN32OLE::Variant? -- Filter types variant
176
+ # @rbs fv: WIN32OLE::Variant? -- Filter values variant
177
+ # @rbs return void
178
+ def select: (?mode: Symbol, ?pt1: Point3d?, ?pt2: Point3d?, ?ft: WIN32OLE::Variant?, ?fv: WIN32OLE::Variant?) -> void
179
+
180
+ # Select entities at specific point
181
+ # @param x [Numeric, Point3d, Array<Numeric>] X coordinate or point object
182
+ # @param y [Numeric, nil] Y coordinate (if using separate coordinates)
183
+ # @return [void]
184
+ # @example Select at specific point
185
+ # ss.select_at_point(10, 20)
186
+ # @example Select at point object
187
+ # ss.select_at_point(Point3d.new(10, 20, 0))
188
+ # @rbs x: Numeric | Point3d | Array[Numeric] -- X coordinate or point object
189
+ # @rbs y: Numeric? -- Y coordinate (if using separate coordinates)
190
+ # @rbs return void
191
+ def select_at_point: (Numeric | Point3d | Array[Numeric] x, Numeric? y) -> void
192
+
193
+ # Select entities using polygonal fence
194
+ # @param points [Array<Point3d>] Polygon vertices
195
+ # @param mode [Symbol] Selection mode (:fence, :window, :crossing)
196
+ # @return [void]
197
+ # @raise [ArgumentError] For invalid mode
198
+ # @example Select using fence
199
+ # points = [[0,0], [10,0], [10,10], [0,10]]
200
+ # ss.select_by_polygon(points: points, mode: :fence)
201
+ # @rbs points: Array[Point3d] -- Polygon vertices
202
+ # @rbs mode: Symbol -- Selection mode (:fence, :window, :crossing)
203
+ # @rbs return void
204
+ # @raise [ArgumentError] For invalid mode
205
+ def select_by_polygon: (?points: Array[Point3d], ?mode: Symbol) -> void
206
+
207
+ # Configure filter through block
208
+ # @yield [Filter] Block for building filter criteria
209
+ # @return [void]
210
+ # @example Create complex filter
211
+ # ss.filter do |f|
212
+ # f.and(f.layer("WALLS"), f.or(f.type("LINE"), f.type("POLYLINE")))
213
+ # end
214
+ # @rbs &: (Filter) -> Filter
215
+ # @rbs return void
216
+ def filter: () { (Filter) -> Filter } -> void
217
+
218
+ private
219
+
220
+ # Create new OLE selection set
221
+ # @return [WIN32OLE] The created OLE selection set
222
+ # @rbs return WIN32OLE
223
+ def create_selection_set: () -> WIN32OLE
224
+
225
+ # Convert filter types to OLE variant
226
+ # @return [WIN32OLE::Variant] OLE variant for filter types
227
+ # @rbs return WIN32OLE::Variant
228
+ def ole_filter_types: () -> WIN32OLE::Variant
229
+
230
+ # Convert filter values to OLE variant
231
+ # @return [WIN32OLE::Variant] OLE variant for filter values
232
+ # @rbs return WIN32OLE::Variant
233
+ def ole_filter_values: () -> WIN32OLE::Variant
234
+ end
235
+ end
@@ -0,0 +1,22 @@
1
+ # Generated from lib/autocad/spline.rb with RBS::Inline
2
+
3
+ module Autocad
4
+ class Spline < Element
5
+ # @rbs return float -- The area of the arc
6
+ def area: () -> float
7
+
8
+ # whether the spline is closed
9
+ def closed?: () -> untyped
10
+
11
+ # ole obj Variant (array of doubles)
12
+ # 3D WCS Control Points for the spline
13
+ # @rbs return Array(Point3d)
14
+ def control_points: () -> Array
15
+
16
+ # set the control points for the spline
17
+ # @rbs pts Array(Point3d) | Array(Array[Double,Double,Double?])
18
+ def control_points=: (Array pts) -> untyped
19
+
20
+ def degree: () -> untyped
21
+ end
22
+ end
@@ -1,19 +1,78 @@
1
1
  # Generated from lib/autocad/text.rb with RBS::Inline
2
2
 
3
3
  module Autocad
4
+ # Single-line text annotation element in AutoCAD
5
+ #
6
+ # Represents a simple text entity with a single line of content.
7
+ # Provides methods for reading, writing, and manipulating text properties.
8
+ #
9
+ # @example Create and modify text
10
+ # text = drawing.model.add_text("Label", [10,5,0])
11
+ # text.height = 2.5
12
+ # text.update("New Label")
4
13
  class Text < Element
5
- def read_ole: (untyped _ole) -> untyped
14
+ # Read text content from OLE object
15
+ #
16
+ # @param _ole [WIN32OLE] The OLE object to read from (unused parameter)
17
+ # @return [String] The text content
18
+ # @rbs (_ole: WIN32OLE) -> String
19
+ def read_ole: (_ole: WIN32OLE) -> String
6
20
 
7
- def write_ole: (untyped text) -> untyped
21
+ # Confirm this is a text element (always true)
22
+ #
23
+ # @return [Boolean] Always returns true for Text objects
24
+ # @rbs return bool
25
+ def text?: () -> bool
8
26
 
9
- def to_regexp: () -> untyped
27
+ # Update text content in AutoCAD
28
+ #
29
+ # @param text [String] The new text content
30
+ # @return [void]
31
+ # @rbs text: String -> void
32
+ def write_ole: (String text) -> untyped
10
33
 
11
- def =~: (untyped reg) -> untyped
34
+ # Convert text content to regex pattern
35
+ #
36
+ # @return [Regexp] A regular expression based on the text content
37
+ # @rbs return Regexp
38
+ def to_regexp: () -> Regexp
12
39
 
13
- def to_s: () -> untyped
40
+ # Toggle text highlighting in the drawing
41
+ #
42
+ # @param flag [Boolean] Whether to highlight (true) or unhighlight (false)
43
+ # @return [void]
44
+ # @example Highlight selected text
45
+ # selected_text.each { |t| t.highlight }
46
+ # @rbs flag: bool -> void
47
+ def highlight: (?bool flag) -> untyped
14
48
 
15
- def bounds: () -> untyped
49
+ # Regex pattern matching against text content
50
+ #
51
+ # @param reg [Regexp] The regular expression to match against
52
+ # @return [Integer, nil] Match position or nil if no match
53
+ # @rbs reg: Regexp -> Integer?
54
+ def =~: (Regexp reg) -> untyped
16
55
 
17
- def method_missing: (untyped meth, *untyped) ?{ (?) -> untyped } -> untyped
56
+ # Get text content as string
57
+ #
58
+ # @return [String] The text content
59
+ # @rbs return String
60
+ def to_s: () -> String
61
+
62
+ # Experimental bounding box calculation
63
+ #
64
+ # @return [BoundingBox] The text's bounding box
65
+ # @note Contains debug code - use with caution
66
+ # @rbs return BoundingBox
67
+ def bounds: () -> BoundingBox
68
+
69
+ # Delegate uppercase methods to OLE object, lowercase to string methods
70
+ #
71
+ # @param meth [Symbol] The method name
72
+ # @param * [Array] Method arguments
73
+ # @param & [Proc] Optional block
74
+ # @return [Object] Result of the method call
75
+ # @rbs (Symbol, *untyped) -> untyped
76
+ def method_missing: (Symbol, *untyped) -> untyped
18
77
  end
19
78
  end
@@ -0,0 +1,6 @@
1
+ # Generated from lib/autocad/text_style.rb with RBS::Inline
2
+
3
+ module Autocad
4
+ class TextStyle < Element
5
+ end
6
+ end
@@ -2,10 +2,27 @@
2
2
 
3
3
  module Autocad
4
4
  class Viewport < Element
5
- def width: () -> untyped
5
+ # Returns the name of the viewport
6
+ # @rbs return String
7
+ def name: () -> String
8
+
9
+ # Returns the center of the viewport
10
+ # @rbs return Point3d
11
+ def center: () -> Point3d
12
+
13
+ # Returns the width of the viewport
14
+ # @rbs return Float
15
+ def width: () -> Float
16
+
17
+ # Splits the viewport
18
+ # the split_type is from the AcViewportSplitType enum
19
+ # can take the integer or symbol corressponding to the enum
20
+ def split: (untyped split_type) -> untyped
6
21
 
7
22
  def height: () -> untyped
8
23
 
9
- def each: () -> untyped
24
+ def lower_left: () -> untyped
25
+
26
+ def upper_right: () -> untyped
10
27
  end
11
28
  end