System Commands
System Commands
System commands are used for file operations, undo/redo, and other system-level functions.
Tip
For detailed file operation APIs and examples, see File Operations.
File Operations
NEW - New
Creates a new drawing file.
Command Name: NEW
Command: NEWCreates a blank drawing with default settings after execution.
OPEN - Open
Opens an existing drawing file (local .webcad file).
Command Name: OPEN
Command: OPENOpens a file selection dialog after execution, supporting .webcad format files.
CLOSE - Close
Closes the current drawing.
Command Name: CLOSE
Command: CLOSEIf there are unsaved changes, you will be prompted to save.
CLOSEX - Close and Exit
Closes the current drawing and exits the application.
Command Name: CLOSEX
Command: CLOSEXQSAVE - Quick Save
Downloads the current drawing as a .webcad file.
Command Name: QSAVE
Command: QSAVE- Downloads using the current file name
- File format is JSON, easy to parse
SAVEAS - Save As
Downloads the drawing with a custom file name.
Command Name: SAVEAS
Command: SAVEASOpens a dialog where you can customize the file name before downloading.
OPENFROMSERVER - Open from Server
Opens a drawing file from the server, displaying the drawing browser dialog.
Command Name: OPENFROMSERVER
Command: OPENFROMSERVERThe drawing browser supports:
- Browsing backend DWG drawings
- Browsing imported drawings (imports)
- Browsing design drawings (designs)
- Selecting normal open or tile open
- Managing branches and versions
SAVESERVER - Save to Server
Saves the current drawing to the server (incremental save).
Command Name: SAVESERVER
Command: SAVESERVERIncremental save features:
- Only saves modified parts (diff)
- Supports version history rollback
- Supports multi-user collaboration conflict detection
OPENFROMLOCAL - Open from Local Cache
Opens a drawing from local IndexedDB cache.
Command Name: OPENFROMLOCAL
Command: OPENFROMLOCALDisplays a list of local drawings to select from.
SAVELOCAL - Save to Local Cache
Saves the current drawing to local IndexedDB cache.
Command Name: SAVELOCAL
Command: SAVELOCALLocal cache features:
- Uses IndexedDB storage with large capacity
- Supports offline access
- Preserves server origin information for subsequent synchronization
Import/Export
IMPORTDWG - Import DWG
Uploads a local DWG/DXF file to the server and opens it.
Command Name: IMPORTDWG
Command: IMPORTDWGImport workflow:
- Select a local DWG/DXF file
- Upload to the server
- Configure import options (drawing name, open method, etc.)
- Server parses and converts the file
- Load into the editor
Supported file formats:
- DWG: AutoCAD drawing format (versions 2000-2018)
- DXF: Drawing Exchange Format
EXPORTDWG - Export DWG
Exports the current drawing in DWG format and downloads it.
Command Name: EXPORTDWG
Command: EXPORTDWGExport options:
- CAD Version: Target DWG version (2000-2018)
- Zoom to Extents: Auto zoom after export
- Use Cache: Accelerate repeated exports
- Explode Groups: Explode groups into independent entities
- Native Dimensions: Export as AutoCAD native dimensions
- Update Original: Incremental modification based on original DWG (imports type only)
Undo/Redo
UNDO - Undo
Undoes the last operation.
Command Name: UNDO
Alias: U
Command: UNDOOptions
| Option | Description |
|---|---|
| Number | Undo a specified number of operations |
ALL | Undo all operations |
B | Return to the previous mark |
M | Set a mark |
Shortcut
Ctrl + Z
REDO - Redo
Redoes the last undone operation.
Command Name: REDO
Command: REDOShortcut
Ctrl + Y
Notes
- Can only redo operations that were just undone
- If a new operation is performed after undoing, redo is no longer available
Selection Operations
SELECTALL - Select All
Selects all visible objects in the current space.
Command Name: SELECTALL
Command: SELECTALL
Found n objects.Shortcut
Ctrl + A
System Settings
SETTINGS - Settings
Opens the system settings dialog.
Command Name: SETTINGS
Command: SETTINGSConfigurable options include:
- Display settings
- Snap settings
- Performance settings
- Shortcut key settings
ABOUT - About
Displays the about dialog.
Command Name: ABOUT
Command: ABOUTDisplays version information and copyright notice.
PLUGINS - Plugin Management
Manages installed plugins.
Command Name: PLUGINS
Command: PLUGINSSWITCHWORKSPACE - Switch Workspace
Switches the interface workspace layout.
Command Name: SWITCHWORKSPACE
Command: SWITCHWORKSPACE
Select workspace: <Select workspace name>Linetype Management
LINETYPELOAD - Load Linetype
Loads linetype definitions from a linetype file or string, supports dialog editing and viewing current linetypes.
Command Name: LINETYPELOAD
Command: LINETYPELOAD
Select linetype definition source [File(F)/String(S)/Dialog(D)/View(V)] <File>:Option descriptions:
| Option | Description |
|---|---|
F | Load linetype definitions from a .lin or .txt file |
S | Enter linetype definition string from command line (multiline input, empty line to end) |
D | Open dialog editor with definition input on the left and format description on the right |
V | View all currently loaded linetype definitions (can copy/export) |
Linetype definition format:
*Linetype name,Description
A,element1,element2,...
; Element description:
; Positive number = Dash length
; Negative number = Gap length
; 0 = Dot
; Examples:
*DASHED,Dashed line __ __ __ __
A,12.7,-6.35
*CENTER,Center line ____ _ ____ _
A,31.75,-6.35,6.35,-6.35LINETYPELIST - List Linetypes
Lists all linetypes loaded in the current drawing.
Command Name: LINETYPELIST
Command: LINETYPELIST
Loaded linetypes:
- Continuous
- Dashed
- Center
- Hidden
...LINETYPEDELETE - Delete Linetype
Deletes unused linetype definitions.
Command Name: LINETYPEDELETE
Command: LINETYPEDELETE
Enter linetype name to delete: <Enter linetype name>Pattern Management
PATLOAD - Load Pattern
Loads hatch pattern definitions from a PAT file or string, supports dialog editing and viewing current patterns.
Command Name: PATLOAD
Command: PATLOAD
Select pattern definition source [File(F)/String(S)/Dialog(D)/View(V)] <File>:Option descriptions:
| Option | Description |
|---|---|
F | Load pattern definitions from a .pat or .txt file |
S | Enter pattern definition string from command line (multiline input, empty line to end) |
D | Open dialog editor with definition input on the left and format description on the right |
V | View all currently loaded pattern definitions (can copy/export) |
PAT pattern definition format:
*Pattern name,Description
angle,x-origin,y-origin,x-offset,y-offset[,dash pattern]
; Parameter description:
; angle = Line angle (degrees)
; x-origin,y-origin = Line start point coordinates
; x-offset,y-offset = Offset between adjacent lines
; dash pattern (optional) = Positive: dash, Negative: gap, 0: dot
; Examples:
*ANSI31,ANSI Iron/Brick/Stone
45,0,0,0,3.175
*HONEY,Honeycomb pattern
0,0,0,0.1875,0.325
60,0,0,0.1875,0.325
120,0.1875,0,0.1875,0.325Script Execution
EXECSTR - Execute Script
Executes a command script string.
Command Name: EXECSTR
Command: EXECSTR
Execute script command
<Script input dialog opens>Opens a script input dialog after execution. Enter the script in the text box and click Execute.
For detailed information, see Script Execution Documentation.
System Variables
Common System Variables
| Variable | Description | Example Value |
|---|---|---|
OSMODE | Object snap mode | 4133 |
ORTHOMODE | Ortho mode | 0/1 |
LTSCALE | Linetype scale | 1.0 |
PLINEWID | Polyline width | 0 |
CLAYER | Current layer | "0" |
CECOLOR | Current color | 256 |
ANTIALIAS | Anti-aliasing | 0/1 |
Setting System Variables
Enter the variable name directly to modify:
Command: OSMODE
OSMODE <4133>: 0Shortcut Key Summary
| Shortcut | Function |
|---|---|
Ctrl + N | New |
Ctrl + O | Open |
Ctrl + S | Save |
Ctrl + Z | Undo |
Ctrl + Y | Redo |
Ctrl + A | Select All |
Ctrl + C | Copy |
Ctrl + V | Paste |
Ctrl + X | Cut |
Delete | Delete |
Escape | Cancel |
Script Example
; System initialization script
OSMODE
4133
LTSCALE
1
ORTHOMODE
1
; Set current layer
CLAYER
0
; Create new layer
MAKELAYER
Border
CLAYER
BorderNext Steps
- Property Commands - Modify object properties
- Script Execution - Batch execute commands
- Command Reference - View all commands