RSWallModeler#

Main entry point for connecting to RSWall and opening or attaching projects.

class rswall.RSWallModeler.RSWallModeler#

Bases: object

Main 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.

Parameters:

filePath (str) – Full path to the RSWall file (.rswall)

Return type:

Wall

Returns:

Wall object for interacting with the opened project

Raises:

grpc.RpcError – If the file cannot be opened

attachActiveProject()#

Attach to the RSWall project that is currently open in the GUI.

Use this instead of openFile when 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 a Wall so every other API call works identically to a project opened via openFile.

Return type:

Wall

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:
  • port (int) – Port to bind the scripting server to (default: 60067)

  • overridePathToExecutable (str) – Optional full path to RSWall.exe

  • timeout (float) – Maximum seconds to wait for startup

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:

None