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.
- checksums.yaml +4 -4
- data/.rubocop/minitest.yml +2 -2
- data/.rubocop/strict.yml +4 -4
- data/.rubocop.yml +36 -33
- data/CHANGELOG.md +5 -5
- data/LICENSE.txt +21 -21
- data/README.md +134 -39
- data/Rakefile +26 -10
- data/exe/autocad +3 -3
- data/gemfiles/rubocop.gemfile +2 -1
- data/lib/autocad/app.rb +127 -28
- data/lib/autocad/arc.rb +3 -0
- data/lib/autocad/block.rb +11 -6
- data/lib/autocad/block_reference.rb +33 -4
- data/lib/autocad/bounding_box.rb +202 -0
- data/lib/autocad/dim_style.rb +4 -0
- data/lib/autocad/drawing.rb +873 -172
- data/lib/autocad/element.rb +217 -25
- data/lib/autocad/errors.rb +9 -0
- data/lib/autocad/filter.rb +502 -168
- data/lib/autocad/layer.rb +129 -41
- data/lib/autocad/layout.rb +120 -0
- data/lib/autocad/line.rb +154 -55
- data/lib/autocad/message_box.rb +95 -95
- data/lib/autocad/model.rb +217 -89
- data/lib/autocad/mtext.rb +189 -110
- data/lib/autocad/plot.rb +45 -0
- data/lib/autocad/plot_configuration.rb +372 -0
- data/lib/autocad/point.rb +7 -0
- data/lib/autocad/point3d.rb +18 -11
- data/lib/autocad/pviewport.rb +136 -21
- data/lib/autocad/selection_filter.rb +358 -180
- data/lib/autocad/selection_set.rb +140 -61
- data/lib/autocad/selection_set_adapter.rb +187 -8
- data/lib/autocad/spline.rb +27 -0
- data/lib/autocad/text.rb +66 -11
- data/lib/autocad/text_style.rb +4 -0
- data/lib/autocad/version.rb +1 -1
- data/lib/autocad/viewport.rb +57 -0
- data/lib/autocad.rb +126 -30
- data/lib/faa/cleanup.rb +137 -0
- data/lib/win32ole_helper.rb +52 -0
- data/rbs_collection.lock.yaml +38 -18
- data/sig/generated/autocad/app.rbs +278 -251
- data/sig/generated/autocad/arc.rbs +6 -3
- data/sig/generated/autocad/block.rbs +8 -5
- data/sig/generated/autocad/block_reference.rbs +99 -59
- data/sig/generated/autocad/bounding_box.rbs +78 -0
- data/sig/generated/autocad/dim_style.rbs +6 -0
- data/sig/generated/autocad/drawing.rbs +597 -158
- data/sig/generated/autocad/element.rbs +233 -166
- data/sig/generated/autocad/errors.rbs +29 -23
- data/sig/generated/autocad/filter.rbs +388 -60
- data/sig/generated/autocad/layer.rbs +76 -19
- data/sig/generated/autocad/layout.rbs +64 -0
- data/sig/generated/autocad/line.rbs +128 -25
- data/sig/generated/autocad/message_box.rbs +81 -81
- data/sig/generated/autocad/model.rbs +115 -41
- data/sig/generated/autocad/mtext.rbs +123 -0
- data/sig/generated/autocad/plot.rbs +26 -0
- data/sig/generated/autocad/plot_configuration.rbs +176 -0
- data/sig/generated/autocad/point.rbs +7 -0
- data/sig/generated/autocad/point3d.rbs +70 -66
- data/sig/generated/autocad/pviewport.rbs +64 -0
- data/sig/generated/autocad/selection_filter.rbs +226 -50
- data/sig/generated/autocad/selection_set.rbs +112 -37
- data/sig/generated/autocad/selection_set_adapter.rbs +235 -28
- data/sig/generated/autocad/spline.rbs +22 -0
- data/sig/generated/autocad/text.rbs +66 -7
- data/sig/generated/autocad/text_style.rbs +6 -0
- data/sig/generated/autocad/viewport.rbs +19 -2
- data/sig/generated/autocad.rbs +140 -68
- data/sig/generated/faa/cleanup.rbs +53 -0
- data/sig/generated/win32ole_helper.rbs +9 -0
- data/sig/prototype/lib/autocad/app.rbs +3 -1
- data/sig/prototype/lib/autocad/bounding_box.rbs +15 -0
- data/sig/prototype/lib/autocad/drawing.rbs +6 -0
- data/sig/prototype/lib/autocad/layer.rbs +5 -0
- data/sig/prototype/lib/autocad/viewport.rbs +7 -0
- data/sig/prototype/lib/autocad.rbs +1 -1
- metadata +29 -5
- data/event_handler.log +0 -24
- data/sig/generated/autocad/text_node.rbs +0 -37
@@ -1,25 +1,128 @@
|
|
1
|
-
# Generated from lib/autocad/line.rb with RBS::Inline
|
2
|
-
|
3
|
-
module Autocad
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
1
|
+
# Generated from lib/autocad/line.rb with RBS::Inline
|
2
|
+
|
3
|
+
module Autocad
|
4
|
+
# Represents a line entity in AutoCAD, providing access to geometric properties and spatial relationships.
|
5
|
+
#
|
6
|
+
# Key Features:
|
7
|
+
# - Length calculation
|
8
|
+
# - Start/end point coordinates
|
9
|
+
# - 3D orientation properties
|
10
|
+
# - Thickness control
|
11
|
+
# - Geometric vector analysis
|
12
|
+
#
|
13
|
+
# Geometric Relationships:
|
14
|
+
# Normal (Z-axis)
|
15
|
+
# ↑
|
16
|
+
# │
|
17
|
+
# Start ●───┼───● End
|
18
|
+
# │
|
19
|
+
# └─── Delta Vector
|
20
|
+
#
|
21
|
+
# @example Create and query a line
|
22
|
+
# line = drawing.model.add_line([0,0,0], [5,5,0])
|
23
|
+
# puts line.length # => 7.0710678118654755
|
24
|
+
# puts line.delta # => (5.0, 5.0, 0.0)
|
25
|
+
class Line < Element
|
26
|
+
# Calculates the linear length of the line segment.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# line = drawing.model.add_line([0,0,0], [5,5,0])
|
30
|
+
# puts line.length # => 7.0710678118654755
|
31
|
+
#
|
32
|
+
# @return [Float] The length of the line
|
33
|
+
# @rbs return float
|
34
|
+
def length: () -> float
|
35
|
+
|
36
|
+
# Type-check method confirming this is a line entity.
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# line.line? # => true
|
40
|
+
#
|
41
|
+
# @return [Boolean] Always returns true for Line objects
|
42
|
+
# @rbs return bool
|
43
|
+
def line?: () -> bool
|
44
|
+
|
45
|
+
# 3D coordinates of the line's starting point in World Coordinate System (WCS).
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# start = line.start_point
|
49
|
+
# puts start # => (0.0, 0.0, 0.0)
|
50
|
+
#
|
51
|
+
# @return [Point3d] The start point coordinates
|
52
|
+
# @rbs return Point3d
|
53
|
+
def start_point: () -> Point3d
|
54
|
+
|
55
|
+
# 3D coordinates of the line's endpoint in World Coordinate System (WCS).
|
56
|
+
#
|
57
|
+
# @example
|
58
|
+
# ending = line.end_point
|
59
|
+
# puts ending # => (5.0, 5.0, 0.0)
|
60
|
+
#
|
61
|
+
# @return [Point3d] The end point coordinates
|
62
|
+
# @rbs return Point3d
|
63
|
+
def end_point: () -> Point3d
|
64
|
+
|
65
|
+
# Unit vector perpendicular to the line's plane (Z-axis direction by default).
|
66
|
+
#
|
67
|
+
# Properties:
|
68
|
+
# - Always returns unit vector (magnitude = 1)
|
69
|
+
# - Affects shading and 3D operations
|
70
|
+
#
|
71
|
+
# @example
|
72
|
+
# line.normal # => (0.0, 0.0, 1.0)
|
73
|
+
#
|
74
|
+
# @return [Point3d] The normal vector
|
75
|
+
# @rbs return Point3d
|
76
|
+
def normal: () -> Point3d
|
77
|
+
|
78
|
+
# Extrusion thickness along the normal vector (3D effect).
|
79
|
+
#
|
80
|
+
# Note:
|
81
|
+
# - Positive values extrude in normal direction
|
82
|
+
# - Negative values extrude opposite direction
|
83
|
+
# - 0 = 2D line
|
84
|
+
#
|
85
|
+
# @example
|
86
|
+
# line.thickness = 2.5 # Creates 3D prism
|
87
|
+
#
|
88
|
+
# @return [Float] The current thickness value
|
89
|
+
# @rbs return float
|
90
|
+
def thickness: () -> float
|
91
|
+
|
92
|
+
# Directional vector from start to end point (equivalent to `end_point - start_point`).
|
93
|
+
#
|
94
|
+
# Mathematical Properties:
|
95
|
+
# - X/Y/Z components = coordinate differences
|
96
|
+
# - Magnitude = line length
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
# line.delta # => (5.0, 5.0, 0.0)
|
100
|
+
# line.delta.magnitude == line.length # => true
|
101
|
+
#
|
102
|
+
# @return [Point3d] The vector from start to end point
|
103
|
+
# @rbs return Point3d
|
104
|
+
def delta: () -> Point3d
|
105
|
+
end
|
106
|
+
|
107
|
+
class Circle < Element
|
108
|
+
# The center point of the circle in World Coordinate System (WCS)
|
109
|
+
# @rbs return Point3d
|
110
|
+
def center: () -> Point3d
|
111
|
+
|
112
|
+
# The radius of the circle
|
113
|
+
# @rbs return float
|
114
|
+
def radius: () -> float
|
115
|
+
|
116
|
+
def inspect: () -> untyped
|
117
|
+
end
|
118
|
+
|
119
|
+
class Polyline < Element
|
120
|
+
# The total length of all polyline segments
|
121
|
+
# @rbs return float
|
122
|
+
def length: () -> float
|
123
|
+
|
124
|
+
# Array of all vertex coordinates in the polyline
|
125
|
+
# @rbs return Array[Point3d]
|
126
|
+
def coordinates: () -> Array[Point3d]
|
127
|
+
end
|
128
|
+
end
|
@@ -1,81 +1,81 @@
|
|
1
|
-
# Generated from lib/autocad/message_box.rb with RBS::Inline
|
2
|
-
|
3
|
-
module WinAPI
|
4
|
-
extend Fiddle::Importer
|
5
|
-
|
6
|
-
include Fiddle::BasicTypes
|
7
|
-
|
8
|
-
include Fiddle::Win32Types
|
9
|
-
|
10
|
-
def get_foreground_window: () -> untyped
|
11
|
-
|
12
|
-
def self.get_text_of_active_window: () -> untyped
|
13
|
-
|
14
|
-
module MB
|
15
|
-
OK: ::Integer
|
16
|
-
|
17
|
-
CANCEL: ::Integer
|
18
|
-
|
19
|
-
ABORT: ::Integer
|
20
|
-
|
21
|
-
RETRY: ::Integer
|
22
|
-
|
23
|
-
IGNORE: ::Integer
|
24
|
-
|
25
|
-
YES: ::Integer
|
26
|
-
|
27
|
-
NO: ::Integer
|
28
|
-
|
29
|
-
module ICON
|
30
|
-
ERROR: ::Integer
|
31
|
-
|
32
|
-
QUESTION: ::Integer
|
33
|
-
|
34
|
-
INFORMATION: ::Integer
|
35
|
-
|
36
|
-
WARNING: ::Integer
|
37
|
-
end
|
38
|
-
|
39
|
-
module BTN
|
40
|
-
OK: ::Integer
|
41
|
-
|
42
|
-
OKCANCEL: ::Integer
|
43
|
-
|
44
|
-
ABORTRETRYIGNORE: ::Integer
|
45
|
-
|
46
|
-
YESNO: ::Integer
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# msgbox_yesno('Do you want to continue?') do |y|
|
52
|
-
# if y
|
53
|
-
# puts 'proceeding with ...'
|
54
|
-
# else
|
55
|
-
# puts 'cancelled ...'
|
56
|
-
# end
|
57
|
-
# end
|
58
|
-
#
|
59
|
-
# msgbox('We are finished here')
|
60
|
-
#
|
61
|
-
# loop do
|
62
|
-
# puts WinAPI.get_text_of_active_window
|
63
|
-
# sleep 1
|
64
|
-
# end
|
65
|
-
module Kernel
|
66
|
-
# @rbs str: String
|
67
|
-
# @rbs return String
|
68
|
-
def self?.L: (String str) -> String
|
69
|
-
|
70
|
-
# @example
|
71
|
-
# msg_box_yesno("Do you want to continue") do |y|
|
72
|
-
# if y
|
73
|
-
# puts "proceeding"
|
74
|
-
# else
|
75
|
-
# puts "cancelled"
|
76
|
-
# end
|
77
|
-
# end
|
78
|
-
def self?.msgbox_yesno: (untyped content, ?title: untyped) -> untyped
|
79
|
-
|
80
|
-
def self?.msgbox: (untyped content, ?title: untyped) -> untyped
|
81
|
-
end
|
1
|
+
# Generated from lib/autocad/message_box.rb with RBS::Inline
|
2
|
+
|
3
|
+
module WinAPI
|
4
|
+
extend Fiddle::Importer
|
5
|
+
|
6
|
+
include Fiddle::BasicTypes
|
7
|
+
|
8
|
+
include Fiddle::Win32Types
|
9
|
+
|
10
|
+
def get_foreground_window: () -> untyped
|
11
|
+
|
12
|
+
def self.get_text_of_active_window: () -> untyped
|
13
|
+
|
14
|
+
module MB
|
15
|
+
OK: ::Integer
|
16
|
+
|
17
|
+
CANCEL: ::Integer
|
18
|
+
|
19
|
+
ABORT: ::Integer
|
20
|
+
|
21
|
+
RETRY: ::Integer
|
22
|
+
|
23
|
+
IGNORE: ::Integer
|
24
|
+
|
25
|
+
YES: ::Integer
|
26
|
+
|
27
|
+
NO: ::Integer
|
28
|
+
|
29
|
+
module ICON
|
30
|
+
ERROR: ::Integer
|
31
|
+
|
32
|
+
QUESTION: ::Integer
|
33
|
+
|
34
|
+
INFORMATION: ::Integer
|
35
|
+
|
36
|
+
WARNING: ::Integer
|
37
|
+
end
|
38
|
+
|
39
|
+
module BTN
|
40
|
+
OK: ::Integer
|
41
|
+
|
42
|
+
OKCANCEL: ::Integer
|
43
|
+
|
44
|
+
ABORTRETRYIGNORE: ::Integer
|
45
|
+
|
46
|
+
YESNO: ::Integer
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# msgbox_yesno('Do you want to continue?') do |y|
|
52
|
+
# if y
|
53
|
+
# puts 'proceeding with ...'
|
54
|
+
# else
|
55
|
+
# puts 'cancelled ...'
|
56
|
+
# end
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# msgbox('We are finished here')
|
60
|
+
#
|
61
|
+
# loop do
|
62
|
+
# puts WinAPI.get_text_of_active_window
|
63
|
+
# sleep 1
|
64
|
+
# end
|
65
|
+
module Kernel
|
66
|
+
# @rbs str: String
|
67
|
+
# @rbs return String
|
68
|
+
def self?.L: (String str) -> String
|
69
|
+
|
70
|
+
# @example
|
71
|
+
# msg_box_yesno("Do you want to continue") do |y|
|
72
|
+
# if y
|
73
|
+
# puts "proceeding"
|
74
|
+
# else
|
75
|
+
# puts "cancelled"
|
76
|
+
# end
|
77
|
+
# end
|
78
|
+
def self?.msgbox_yesno: (untyped content, ?title: untyped) -> untyped
|
79
|
+
|
80
|
+
def self?.msgbox: (untyped content, ?title: untyped) -> untyped
|
81
|
+
end
|
@@ -1,41 +1,115 @@
|
|
1
|
-
# Generated from lib/autocad/model.rb with RBS::Inline
|
2
|
-
|
3
|
-
module Autocad
|
4
|
-
module ModelTrait
|
5
|
-
|
6
|
-
|
7
|
-
# @rbs
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
# @rbs
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
1
|
+
# Generated from lib/autocad/model.rb with RBS::Inline
|
2
|
+
|
3
|
+
module Autocad
|
4
|
+
module ModelTrait
|
5
|
+
# Iterate through all elements in the model space
|
6
|
+
# @rbs return Enumerator[Autocad::Element]
|
7
|
+
# @rbs &: (Autocad::Element) -> void
|
8
|
+
def each: () { (Autocad::Element) -> void } -> Enumerator[Autocad::Element]
|
9
|
+
|
10
|
+
# Check if this model is an external reference
|
11
|
+
# @rbs return bool
|
12
|
+
def xref?: () -> bool
|
13
|
+
|
14
|
+
# Attach an external reference to the model
|
15
|
+
# @rbs path: String
|
16
|
+
# @rbs name: String
|
17
|
+
# @rbs pt: Array[Numeric] | Autocad::Point3d
|
18
|
+
# @rbs x_scale: Numeric
|
19
|
+
# @rbs y_scale: Numeric
|
20
|
+
# @rbs z_scale: Numeric
|
21
|
+
# @rbs rotation: Numeric
|
22
|
+
# @rbs overlay: bool
|
23
|
+
# @rbs password: String?
|
24
|
+
# @rbs return Autocad::BlockReference?
|
25
|
+
def attach_external_reference: (String path, name: String, ?pt: Array[Numeric] | Autocad::Point3d, ?x_scale: Numeric, ?y_scale: Numeric, ?z_scale: Numeric, ?rotation: Numeric, ?overlay: bool, ?password: String?) -> Autocad::BlockReference?
|
26
|
+
|
27
|
+
# Add a line to the model
|
28
|
+
# @rbs pt1: Array[Numeric] | Autocad::Point3d
|
29
|
+
# @rbs pt2: Array[Numeric] | Autocad::Point3d
|
30
|
+
# @rbs layer: String?
|
31
|
+
# @rbs return Autocad::Line?
|
32
|
+
def add_line: (Array[Numeric] | Autocad::Point3d pt1, Array[Numeric] | Autocad::Point3d pt2, ?layer: String?) -> Autocad::Line?
|
33
|
+
|
34
|
+
# Get the layout associated with this model
|
35
|
+
# @rbs return Autocad::Layout
|
36
|
+
def layout: () -> Autocad::Layout
|
37
|
+
|
38
|
+
# Add an arc to the model
|
39
|
+
# @rbs center: Array[Numeric] | Autocad::Point3d
|
40
|
+
# @rbs radius: Numeric
|
41
|
+
# @rbs start_angle: Numeric
|
42
|
+
# @rbs end_angle: Numeric
|
43
|
+
# @rbs return Autocad::Arc
|
44
|
+
# @raise [Autocad::Error] If arc creation fails
|
45
|
+
def add_arc: (Array[Numeric] | Autocad::Point3d center, Numeric radius, Numeric start_angle, Numeric end_angle) -> Autocad::Arc
|
46
|
+
|
47
|
+
# Add a circle to the model
|
48
|
+
# @rbs center: Array[Numeric] | Autocad::Point3d
|
49
|
+
# @rbs radius: Numeric
|
50
|
+
# @rbs return Autocad::Circle
|
51
|
+
# @raise [Autocad::Error] If circle creation fails
|
52
|
+
def add_circle: (Array[Numeric] | Autocad::Point3d center, Numeric radius) -> Autocad::Circle
|
53
|
+
|
54
|
+
# Add a rectangular polyline to the model
|
55
|
+
# @rbs lower_left: Array[Numeric] | Autocad::Point3d
|
56
|
+
# @rbs upper_right: Array[Numeric] | Autocad::Point3d
|
57
|
+
# @rbs return Autocad::Element
|
58
|
+
# @raise [Autocad::Error] If rectangle creation fails
|
59
|
+
def add_rectangle: (Array[Numeric] | Autocad::Point3d lower_left, Array[Numeric] | Autocad::Point3d upper_right) -> Autocad::Element
|
60
|
+
|
61
|
+
# Add an ellipse to the model
|
62
|
+
# @rbs center: Array[Numeric] | Autocad::Point3d
|
63
|
+
# @rbs major_axis: Numeric
|
64
|
+
# @rbs radius_ratio: Numeric
|
65
|
+
# @rbs return Autocad::Ellipse
|
66
|
+
# @raise [Autocad::Error] If ellipse creation fails
|
67
|
+
def add_ellipse: (Array[Numeric] | Autocad::Point3d center, Numeric major_axis, Numeric radius_ratio) -> Autocad::Ellipse
|
68
|
+
|
69
|
+
# Add a spline to the model
|
70
|
+
# @rbs points: Array[Array[Numeric] | Autocad::Point3d]
|
71
|
+
# @rbs start_tangent: Array[Numeric] | Autocad::Point3d
|
72
|
+
# @rbs end_tangent: Array[Numeric] | Autocad::Point3d
|
73
|
+
# @rbs return Autocad::Spline
|
74
|
+
# @raise [Autocad::Error] If spline creation fails
|
75
|
+
def add_spline: (Array[Array[Numeric] | Autocad::Point3d] points, Array[Numeric] | Autocad::Point3d start_tangent, Array[Numeric] | Autocad::Point3d end_tangent) -> Autocad::Spline
|
76
|
+
|
77
|
+
# Get the parent drawing document
|
78
|
+
# @rbs return Autocad::Drawing
|
79
|
+
def drawing: () -> Autocad::Drawing
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
# Internal method to create/get a layer
|
84
|
+
# @rbs name: String
|
85
|
+
# @rbs color: Numeric | Symbol | String?
|
86
|
+
# @rbs return Autocad::Layer
|
87
|
+
def create_layer: (String name, ?Numeric | Symbol | String? color) -> Autocad::Layer
|
88
|
+
end
|
89
|
+
|
90
|
+
# Paper space container class
|
91
|
+
class PaperSpace < Element
|
92
|
+
include ModelTrait
|
93
|
+
|
94
|
+
# Add a paper space viewport
|
95
|
+
# @rbs center: Array[Numeric] | Autocad::Point3d
|
96
|
+
# @rbs width: Numeric
|
97
|
+
# @rbs height: Numeric
|
98
|
+
# @rbs return Autocad::PViewport
|
99
|
+
# @raise [StandardError] If viewport creation fails
|
100
|
+
def add_pv_viewport: (Array[Numeric] | Autocad::Point3d center, width: Numeric, height: Numeric) -> Autocad::PViewport
|
101
|
+
|
102
|
+
# Get all paper space viewports
|
103
|
+
# @rbs return Array[Autocad::PViewport]
|
104
|
+
def pviewports: () -> Array[Autocad::PViewport]
|
105
|
+
|
106
|
+
# Delete all paper space viewports
|
107
|
+
# @rbs return void
|
108
|
+
def clear_pviewports: () -> void
|
109
|
+
end
|
110
|
+
|
111
|
+
# Model space container class
|
112
|
+
class ModelSpace < Element
|
113
|
+
include ModelTrait
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# Generated from lib/autocad/mtext.rb with RBS::Inline
|
2
|
+
|
3
|
+
module Autocad
|
4
|
+
# Multi-line formatted text container in AutoCAD
|
5
|
+
#
|
6
|
+
# Represents a rich text entity with multiple lines and formatting.
|
7
|
+
# Supports Liquid templates, table cell awareness, and line-by-line operations.
|
8
|
+
#
|
9
|
+
# @example Create and render a template
|
10
|
+
# specs = drawing.model.add_mtext("Project: {{name}}")
|
11
|
+
# specs.render(name: "Tower A")
|
12
|
+
class MText < Element
|
13
|
+
# @rbs attr_reader original: String
|
14
|
+
# @rbs attr_reader ole_obj: WIN32OLE
|
15
|
+
attr_reader original: untyped
|
16
|
+
|
17
|
+
# @rbs attr_reader original: String
|
18
|
+
# @rbs attr_reader ole_obj: WIN32OLE
|
19
|
+
attr_reader ole_obj: untyped
|
20
|
+
|
21
|
+
# Convert content to regex pattern
|
22
|
+
#
|
23
|
+
# @return [Regexp] A regular expression based on the text content
|
24
|
+
# @rbs return Regexp
|
25
|
+
def to_regexp: () -> Regexp
|
26
|
+
|
27
|
+
# Check for empty content
|
28
|
+
#
|
29
|
+
# @return [Boolean] True if the MText has no content
|
30
|
+
# @rbs return bool
|
31
|
+
def empty?: () -> bool
|
32
|
+
|
33
|
+
# Type check for multi-line text (always true)
|
34
|
+
#
|
35
|
+
# @return [Boolean] Always returns true for MText objects
|
36
|
+
# @rbs return bool
|
37
|
+
def mtext?: () -> bool
|
38
|
+
|
39
|
+
# Override text type check (always false)
|
40
|
+
#
|
41
|
+
# @return [Boolean] Always returns false for MText objects
|
42
|
+
# @rbs return bool
|
43
|
+
def text?: () -> bool
|
44
|
+
|
45
|
+
# Get number of text lines
|
46
|
+
#
|
47
|
+
# @return [Integer] The number of lines in the MText
|
48
|
+
# @rbs return Integer
|
49
|
+
def size: () -> Integer
|
50
|
+
|
51
|
+
# Read content from OLE object
|
52
|
+
#
|
53
|
+
# @param ole [WIN32OLE] The OLE object to read from
|
54
|
+
# @return [String] The text content
|
55
|
+
# @rbs ole: WIN32OLE -> String
|
56
|
+
def read_ole: (WIN32OLE ole) -> untyped
|
57
|
+
|
58
|
+
# Update text content with cell awareness
|
59
|
+
#
|
60
|
+
# @param text [String] The new text content
|
61
|
+
# @return [void]
|
62
|
+
# @rbs text: String -> void
|
63
|
+
def write_ole: (String text) -> untyped
|
64
|
+
|
65
|
+
# Update text content for regular MText
|
66
|
+
#
|
67
|
+
# @param text [String] The new text content
|
68
|
+
# @return [void]
|
69
|
+
# @rbs text: String -> void
|
70
|
+
def write_ole_regular: (String text) -> untyped
|
71
|
+
|
72
|
+
# Update text content for MText in table cell
|
73
|
+
#
|
74
|
+
# @param text [String] The new text content
|
75
|
+
# @return [void]
|
76
|
+
# @rbs text: String -> void
|
77
|
+
def write_ole_in_cell: (String text) -> untyped
|
78
|
+
|
79
|
+
# Full content rewrite with line-by-line updates
|
80
|
+
#
|
81
|
+
# @param text [String] The new text content
|
82
|
+
# @return [void]
|
83
|
+
# @rbs text: String -> void
|
84
|
+
def update_ole!: (String text) -> untyped
|
85
|
+
|
86
|
+
# Get content as string
|
87
|
+
#
|
88
|
+
# @return [String] The text content
|
89
|
+
# @rbs return String
|
90
|
+
def to_s: () -> String
|
91
|
+
|
92
|
+
# Regex pattern matching against text content
|
93
|
+
#
|
94
|
+
# @param reg [Regexp] The regular expression to match against
|
95
|
+
# @return [Integer, nil] Match position or nil if no match
|
96
|
+
# @rbs reg: Regexp -> Integer?
|
97
|
+
def =~: (Regexp reg) -> untyped
|
98
|
+
|
99
|
+
# Check for Liquid template placeholders
|
100
|
+
#
|
101
|
+
# @return [Boolean] True if the text contains template placeholders
|
102
|
+
# @rbs return bool
|
103
|
+
def template?: () -> bool
|
104
|
+
|
105
|
+
# Render Liquid template with provided context
|
106
|
+
#
|
107
|
+
# @param h [Hash] The template variables
|
108
|
+
# @return [self] The MText object
|
109
|
+
# @example Render a template with variables
|
110
|
+
# mtext.render(client: "ABC Corp", floors: 42)
|
111
|
+
# @rbs h: Hash[Symbol, untyped] -> self
|
112
|
+
def render: (?Hash[Symbol, untyped] h) -> untyped
|
113
|
+
|
114
|
+
# Delegate uppercase methods to OLE object, lowercase to string methods
|
115
|
+
#
|
116
|
+
# @param meth [Symbol] The method name
|
117
|
+
# @param * [Array] Method arguments
|
118
|
+
# @param & [Proc] Optional block
|
119
|
+
# @return [Object] Result of the method call
|
120
|
+
# @rbs (Symbol, *untyped) -> untyped
|
121
|
+
def method_missing: (Symbol, *untyped) -> untyped
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Generated from lib/autocad/plot.rb with RBS::Inline
|
2
|
+
|
3
|
+
module Autocad
|
4
|
+
class Plot < Element
|
5
|
+
# Configure which layouts to include in the plot
|
6
|
+
# @rbs *layouts: Array[String | Autocad::Layout] | String | Autocad::Layout
|
7
|
+
# @rbs return void
|
8
|
+
def set_layouts_to_plot: (*Array[String | Autocad::Layout] | String | Autocad::Layout layouts) -> void
|
9
|
+
|
10
|
+
# Display full plot preview window
|
11
|
+
# @rbs return void
|
12
|
+
def plot_preview: () -> void
|
13
|
+
|
14
|
+
# Execute plot using configured device
|
15
|
+
# @rbs return void
|
16
|
+
# @raise [Autocad::Error] If device communication fails
|
17
|
+
def plot_to_device: () -> void
|
18
|
+
|
19
|
+
# Plot to file with specified configuration
|
20
|
+
# @rbs filename: String | Pathname
|
21
|
+
# @rbs plot_config: String | Autocad::PlotConfiguration?
|
22
|
+
# @rbs return void
|
23
|
+
# @raise [Autocad::Error] If file creation fails
|
24
|
+
def plot_to_file: (String | Pathname filename, ?plot_config: String | Autocad::PlotConfiguration?) -> void
|
25
|
+
end
|
26
|
+
end
|