RSWallModeler#
Main entry point for connecting to RSWall and opening or attaching projects.
- class rswall.RSWallModeler.RSWallModeler#
Bases:
objectMain entry point for connecting to RSWall and opening projects.
Import as
from rswall.RSWallModeler import RSWallModeler.Example:
modeler = RSWallModeler(port=60067) wall = modeler.openFile(r"C:\path\to\file.rswall") material = wall.getMaterialByName("Soil 1") material.setUnitWeight(18.5) wall.save()
- DEFAULT_PORT = 60067#
- __init__(port=60067)#
Connect to a running RSWall instance.
- Parameters:
port (
int) – Port where RSWall scripting server is listening (default: 60067)
- openFile(filePath)#
Open an RSWall file.
- attachActiveProject()#
Attach to the RSWall project that is currently open in the GUI.
Use this instead of
openFilewhen RSWall is already running and the user has a project open — no file path is required. A new scripting session handle is minted server-side and returned as aWallso every other API call works identically to a project opened viaopenFile.- Return type:
- Returns:
Wall object wrapping the active GUI project.
- Raises:
RuntimeError – If no project is currently active in the RSWall GUI (GetActiveProject returns success=False).
grpc.RpcError – If the attach RPC itself fails (RSWall not running).
Example:
modeler = RSWallModeler(port=60067) wall = modeler.attachActiveProject() print(wall.listWalls())
- classmethod startApplication(port=60067, overridePathToExecutable=None, timeout=120)#
Launch RSWall with scripting server enabled.
- Parameters:
- Raises:
ValueError – If port is out of valid range (49152-65535)
RuntimeError – If RSWall installation not found or port occupied
TimeoutError – If unable to connect within timeout
- Return type: