Core¶
Interfaces, configuration, and exception hierarchy.
CAD Interface (Abstract Base Class)¶
core.cad_interface.CADInterface
¶
Bases: ABC
Abstract interface for CAD application adapters.
connect
abstractmethod
¶
Connect to a CAD application. Try to get existing instance first, then start new if needed.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if connection successful, False otherwise
TYPE:
|
disconnect
abstractmethod
¶
Disconnect from CAD application.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if disconnection successful
TYPE:
|
is_connected
abstractmethod
¶
Check if currently connected to CAD.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if connected
TYPE:
|
draw_line
abstractmethod
¶
draw_line(
start: Coordinate,
end: Coordinate,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
_skip_refresh: bool = False,
) -> str
Draw a line from start to end point.
| PARAMETER | DESCRIPTION |
|---|---|
start
|
Start point (x, y) or (x, y, z)
TYPE:
|
end
|
End point (x, y) or (x, y, z)
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_circle
abstractmethod
¶
draw_circle(
center: Coordinate,
radius: float,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
_skip_refresh: bool = False,
) -> str
Draw a circle.
| PARAMETER | DESCRIPTION |
|---|---|
center
|
Center point (x, y) or (x, y, z)
TYPE:
|
radius
|
Circle radius
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_arc
abstractmethod
¶
draw_arc(
center: Coordinate,
radius: float,
start_angle: float,
end_angle: float,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
_skip_refresh: bool = False,
) -> str
Draw an arc.
| PARAMETER | DESCRIPTION |
|---|---|
center
|
Center point
TYPE:
|
radius
|
Arc radius
TYPE:
|
start_angle
|
Start angle in degrees
TYPE:
|
end_angle
|
End angle in degrees
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_rectangle
abstractmethod
¶
draw_rectangle(
corner1: Coordinate,
corner2: Coordinate,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
_skip_refresh: bool = False,
) -> str
Draw a rectangle from two opposite corners.
| PARAMETER | DESCRIPTION |
|---|---|
corner1
|
First corner (x, y)
TYPE:
|
corner2
|
Opposite corner (x, y)
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID (may be multiple for rectangle polyline)
TYPE:
|
draw_polyline
abstractmethod
¶
draw_polyline(
points: List[Coordinate],
closed: bool = False,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
_skip_refresh: bool = False,
) -> str
Draw a polyline through multiple points.
| PARAMETER | DESCRIPTION |
|---|---|
points
|
List of points
TYPE:
|
closed
|
Whether to close the polyline
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_ellipse
abstractmethod
¶
draw_ellipse(
center: Coordinate,
major_axis_end: Coordinate,
minor_axis_ratio: float,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
) -> str
Draw an ellipse.
| PARAMETER | DESCRIPTION |
|---|---|
center
|
Center point
TYPE:
|
major_axis_end
|
End of major axis vector
TYPE:
|
minor_axis_ratio
|
Ratio of minor to major axis (0-1)
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_text
abstractmethod
¶
draw_text(
position: Coordinate,
text: str,
height: float = 2.5,
rotation: float = 0.0,
layer: str = "0",
color: str | int = "white",
_skip_refresh: bool = False,
) -> str
Add text to the drawing.
| PARAMETER | DESCRIPTION |
|---|---|
position
|
Text position
TYPE:
|
text
|
Text content
TYPE:
|
height
|
Text height
TYPE:
|
rotation
|
Rotation angle in degrees
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_hatch
abstractmethod
¶
draw_hatch(
boundary_points: List[Coordinate],
pattern: str = "SOLID",
scale: float = 1.0,
angle: float = 0.0,
color: str | int = "white",
layer: str = "0",
) -> str
Create a hatch (filled area) with pattern.
| PARAMETER | DESCRIPTION |
|---|---|
boundary_points
|
Points defining the boundary
TYPE:
|
pattern
|
Hatch pattern name (SOLID, ANGLE, CROSS, etc.)
TYPE:
|
scale
|
Pattern scale
TYPE:
|
angle
|
Pattern angle in degrees
TYPE:
|
color
|
Fill color
TYPE:
|
layer
|
Layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
add_dimension
abstractmethod
¶
add_dimension(
start: Coordinate,
end: Coordinate,
text: Optional[str] = None,
layer: str = "0",
color: str | int = "white",
offset: float = 10.0,
) -> str
Add a dimension annotation.
| PARAMETER | DESCRIPTION |
|---|---|
start
|
Start point
TYPE:
|
end
|
End point
TYPE:
|
text
|
Optional custom text
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
offset
|
Distance to offset the dimension line from the edge (default: 10.0)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_spline
abstractmethod
¶
draw_spline(
points: List[Coordinate],
closed: bool = False,
degree: int = 3,
layer: str = "0",
color: str | int = "white",
lineweight: int = 0,
_skip_refresh: bool = False,
) -> str
Draw a spline curve through points.
| PARAMETER | DESCRIPTION |
|---|---|
points
|
List of control points (minimum 2)
TYPE:
|
closed
|
Whether the spline should be closed
TYPE:
|
degree
|
Degree of the spline (1-3, default 3 = cubic)
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
lineweight
|
Line weight value
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_leader
abstractmethod
¶
draw_leader(
points: List[Coordinate],
text: Optional[str] = None,
text_height: float = 2.5,
layer: str = "0",
color: str | int = "white",
leader_type: str = "line_with_arrow",
_skip_refresh: bool = False,
) -> str
Draw a leader (dimension leader line) with optional text annotation.
| PARAMETER | DESCRIPTION |
|---|---|
points
|
List of control points (minimum 2 for simple, multiple for multi-arrow)
TYPE:
|
text
|
Optional annotation text
TYPE:
|
text_height
|
Height of annotation text (default: 2.5)
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
leader_type
|
Type of leader: - "line_with_arrow": Straight lines with arrow (default) - "line_no_arrow": Straight lines without arrow - "spline_with_arrow": Smooth spline with arrow - "spline_no_arrow": Smooth spline without arrow
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
draw_mleader
abstractmethod
¶
draw_mleader(
base_point: Coordinate,
leader_groups: List[List[Coordinate]],
text: Optional[str] = None,
text_height: float = 2.5,
layer: str = "0",
color: str | int = "white",
arrow_style: str = "_ARROW",
_skip_refresh: bool = False,
) -> str
Draw a multi-leader with multiple arrow lines pointing to same annotation.
| PARAMETER | DESCRIPTION |
|---|---|
base_point
|
Base point where annotation text is placed
TYPE:
|
leader_groups
|
List of leader line paths, each with 2+ points Example: [[(0,0), (10,10)], [(0,0), (20,-5)], [(0,0), (15,20)]]
TYPE:
|
text
|
Optional annotation text
TYPE:
|
text_height
|
Height of annotation text (default: 2.5)
TYPE:
|
layer
|
Layer name
TYPE:
|
color
|
Color name or index
TYPE:
|
arrow_style
|
Arrow head style (default: "_ARROW") Supported: "_ARROW", "_DOT", "_CLOSED_FILLED", "_OBLIQUE", "_OPEN", etc.
TYPE:
|
_skip_refresh
|
Internal flag to skip view refresh (used for batch operations)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Entity handle/ID
TYPE:
|
create_rectangular_array
abstractmethod
¶
create_rectangular_array(
handles: List[str],
rows: int,
columns: int,
row_spacing: float,
column_spacing: float,
) -> List[str]
Create a rectangular array of entities.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
Entity handles to array
TYPE:
|
rows
|
Number of rows
TYPE:
|
columns
|
Number of columns
TYPE:
|
row_spacing
|
Distance between rows
TYPE:
|
column_spacing
|
Distance between columns
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: Handles of all created copies |
create_polar_array
abstractmethod
¶
create_polar_array(
handles: List[str],
center_x: float,
center_y: float,
count: int,
angle_to_fill: float = 360.0,
rotate_items: bool = True,
) -> List[str]
Create a polar (circular) array of entities.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
Entity handles to array
TYPE:
|
center_x
|
X coordinate of rotation center
TYPE:
|
center_y
|
Y coordinate of rotation center
TYPE:
|
count
|
Number of items in the array
TYPE:
|
angle_to_fill
|
Total angle to fill (default: 360 degrees)
TYPE:
|
rotate_items
|
Whether to rotate items as they are copied
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: Handles of all created copies |
create_path_array
abstractmethod
¶
create_path_array(
handles: List[str],
path_points: List[Coordinate],
count: int,
align_items: bool = True,
) -> List[str]
Create an array of entities along a path.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
Entity handles to array
TYPE:
|
path_points
|
Points defining the path
TYPE:
|
count
|
Number of items in the array
TYPE:
|
align_items
|
Whether to align items to path direction
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: Handles of all created copies |
create_layer
abstractmethod
¶
Create a new layer.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Layer name
TYPE:
|
color
|
Layer color
TYPE:
|
lineweight
|
Layer lineweight
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
set_current_layer
abstractmethod
¶
Set the active/current layer.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
get_current_layer
abstractmethod
¶
Get the name of the current active layer.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Layer name
TYPE:
|
list_layers
abstractmethod
¶
Get list of all layers in the drawing.
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: Layer names |
rename_layer
abstractmethod
¶
Rename an existing layer.
| PARAMETER | DESCRIPTION |
|---|---|
old_name
|
Current layer name
TYPE:
|
new_name
|
New layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LayerError
|
If layer not found or cannot be renamed |
delete_layer
abstractmethod
¶
Delete a layer from the drawing. Cannot delete layer 0 (standard layer).
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Layer name to delete
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LayerError
|
If layer not found, is in use, or cannot be deleted |
turn_layer_on
abstractmethod
¶
Turn on (make visible) a layer.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LayerError
|
If layer not found |
turn_layer_off
abstractmethod
¶
Turn off (hide) a layer.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LayerError
|
If layer not found |
is_layer_on
abstractmethod
¶
Check if a layer is visible (turned on).
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if layer is on, False if off
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LayerError
|
If layer not found |
set_layer_color
abstractmethod
¶
Set the color of a layer.
| PARAMETER | DESCRIPTION |
|---|---|
layer_name
|
Name of the layer to modify
TYPE:
|
color
|
Color name (from COLOR_MAP) or ACI index (1-255)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LayerError
|
If layer not found |
ColorError
|
If color is invalid |
set_entities_color_bylayer
abstractmethod
¶
Set entities to use their layer's color (ByLayer).
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles to modify
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Result summary with counts and details
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
CADOperationError
|
If operation fails |
save_drawing
abstractmethod
¶
Save the current drawing to a file.
| PARAMETER | DESCRIPTION |
|---|---|
filepath
|
Full path where to save (e.g., 'C:/drawings/myfile.dwg')
TYPE:
|
filename
|
Just the filename (e.g., 'myfile.dwg'). Uses configured output directory
TYPE:
|
format
|
File format (dwg, dxf, etc.). Default: dwg
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
Note
- If both filepath and filename provided, filepath takes precedence
- If only filename provided, saved to config output directory
- If neither provided, uses current document name or generates timestamp-based name
open_drawing
abstractmethod
¶
Open an existing drawing file.
| PARAMETER | DESCRIPTION |
|---|---|
filepath
|
Path to the drawing file
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
new_drawing
abstractmethod
¶
Create a new blank drawing.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
close_drawing
abstractmethod
¶
Close the current drawing.
| PARAMETER | DESCRIPTION |
|---|---|
save_changes
|
Whether to save changes before closing (default: False)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
get_open_drawings
abstractmethod
¶
Get list of all open drawing filenames.
| RETURNS | DESCRIPTION |
|---|---|
list
|
Drawing names (e.g., ["drawing1.dwg", "drawing2.dwg"])
TYPE:
|
switch_drawing
abstractmethod
¶
Switch to a different open drawing.
| PARAMETER | DESCRIPTION |
|---|---|
drawing_name
|
Name of the drawing to switch to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
zoom_extents
abstractmethod
¶
Zoom to show all entities in view.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
refresh_view
abstractmethod
¶
Refresh/redraw the current view.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
get_screenshot
abstractmethod
¶
Capture a screenshot of the CAD application window.
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Dictionary with keys: - path: Path to the temporary screenshot file - data: Base64 encoded image data (for embedding)
TYPE:
|
delete_entity
abstractmethod
¶
Delete an entity by its handle.
| PARAMETER | DESCRIPTION |
|---|---|
handle
|
Entity handle/ID
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
get_entity_properties
abstractmethod
¶
Get properties of an entity.
| PARAMETER | DESCRIPTION |
|---|---|
handle
|
Entity handle/ID
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict
|
Entity properties
TYPE:
|
set_entity_properties
abstractmethod
¶
Modify entity properties.
| PARAMETER | DESCRIPTION |
|---|---|
handle
|
Entity handle/ID
TYPE:
|
properties
|
Properties to set
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
select_by_color
abstractmethod
¶
Select all entities of a specific color.
| PARAMETER | DESCRIPTION |
|---|---|
color
|
Color name or index
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: List of entity handles |
select_by_layer
abstractmethod
¶
Select all entities on a specific layer.
| PARAMETER | DESCRIPTION |
|---|---|
layer_name
|
Layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: List of entity handles |
select_by_type
abstractmethod
¶
Select all entities of a specific type.
| PARAMETER | DESCRIPTION |
|---|---|
entity_type
|
Entity type (line, circle, etc.)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: List of entity handles |
get_selected_entities
abstractmethod
¶
Get list of currently selected entities.
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: List of entity handles |
clear_selection
abstractmethod
¶
Clear current selection.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
create_block_from_entities
abstractmethod
¶
create_block_from_entities(
block_name: str,
entity_handles: List[str],
insertion_point: Coordinate = (0.0, 0.0, 0.0),
description: str = "",
) -> Dict[str, Any]
Create a block from specified entities.
| PARAMETER | DESCRIPTION |
|---|---|
block_name
|
Name for the new block
TYPE:
|
entity_handles
|
List of entity handles to include in block
TYPE:
|
insertion_point
|
Base point for block definition (default: 0,0,0)
TYPE:
|
description
|
Optional block description
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict[str, Any]
|
Dict[str, Any]: Dictionary with operation status and details - success: bool - block_name: str - total_handles: int - entities_added: int - failed_handles: List[str] - insertion_point: Tuple[float, float, float] |
create_block_from_selection
abstractmethod
¶
create_block_from_selection(
block_name: str,
insertion_point: Coordinate = (0.0, 0.0, 0.0),
description: str = "",
) -> Dict[str, Any]
Create a block from currently selected entities.
| PARAMETER | DESCRIPTION |
|---|---|
block_name
|
Name for the new block
TYPE:
|
insertion_point
|
Base point for block definition (default: 0,0,0)
TYPE:
|
description
|
Optional block description
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict[str, Any]
|
Dict[str, Any]: Dictionary with operation status and details - success: bool - block_name: str - entities_added: int - insertion_point: Tuple[float, float, float] |
move_entities
abstractmethod
¶
Move entities by an offset.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles
TYPE:
|
offset_x
|
X offset
TYPE:
|
offset_y
|
Y offset
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
rotate_entities
abstractmethod
¶
Rotate entities around a point.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles
TYPE:
|
center_x
|
Rotation center X
TYPE:
|
center_y
|
Rotation center Y
TYPE:
|
angle
|
Rotation angle in degrees
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
scale_entities
abstractmethod
¶
scale_entities(
handles: List[str],
center_x: float,
center_y: float,
scale_factor: float,
) -> bool
Scale entities around a point.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles
TYPE:
|
center_x
|
Scale center X
TYPE:
|
center_y
|
Scale center Y
TYPE:
|
scale_factor
|
Scale factor
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
copy_entities
abstractmethod
¶
Copy entities to clipboard.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
paste_entities
abstractmethod
¶
Paste entities from clipboard.
| PARAMETER | DESCRIPTION |
|---|---|
base_point_x
|
Base point X for pasting
TYPE:
|
base_point_y
|
Base point Y for pasting
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
List[str]: Handles of pasted entities |
change_entity_color
abstractmethod
¶
Change color of entities.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles
TYPE:
|
color
|
Color name or index
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
change_entity_layer
abstractmethod
¶
Move entities to a different layer.
| PARAMETER | DESCRIPTION |
|---|---|
handles
|
List of entity handles
TYPE:
|
layer_name
|
Target layer name
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
undo
abstractmethod
¶
Undo last action(s).
| PARAMETER | DESCRIPTION |
|---|---|
count
|
Number of operations to undo (default: 1)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
redo
abstractmethod
¶
Redo last undone action(s).
| PARAMETER | DESCRIPTION |
|---|---|
count
|
Number of operations to redo (default: 1)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful
TYPE:
|
normalize_coordinate
staticmethod
¶
Normalize a coordinate to 3D point (x, y, z).
| PARAMETER | DESCRIPTION |
|---|---|
coord
|
2D or 3D coordinate
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Point
|
3D point with z=0 if not provided
TYPE:
|
validate_lineweight
¶
Validate and return a proper lineweight value.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
Proposed lineweight
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Valid lineweight (or default if invalid)
TYPE:
|
Configuration¶
core.config
¶
Centralized configuration for multiCAD-MCP server. Loads from config.json with fallback defaults.
CADConfig
dataclass
¶
Configuration for a specific CAD application.
OutputConfig
dataclass
¶
Configuration for output files.
DashboardConfig
dataclass
¶
Configuration for the web dashboard.
ServerConfig
dataclass
¶
Complete server configuration.
Exceptions¶
core.exceptions
¶
Custom exceptions for multiCAD-MCP server. Provides domain-specific error handling for CAD operations.