From 560a9c5f57a809cbc0564254181072c351d1fd45 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 12 Mar 2024 00:09:30 +0100 Subject: [PATCH] add `xschem get bbox` command to get whole schematic bbox --- src/scheduler.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scheduler.c b/src/scheduler.c index d7ee49d1..d95dda80 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1136,6 +1136,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!strcmp(argv[2], "backlayer")) { /* number of background layer */ Tcl_SetResult(interp, my_itoa(BACKLAYER), TCL_VOLATILE); } + else if(!strcmp(argv[2], "bbox")) { /* bounding box schematic */ + xRect boundbox; + char res[2048]; + calc_drawing_bbox(&boundbox, 0); + my_snprintf(res, S(res), "%g %g %g %g", boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2); + Tcl_SetResult(interp, res, TCL_VOLATILE); + } else if(!strcmp(argv[2], "bbox_hilighted")) { /* bounding box of highlinhted objects */ xRect boundbox; char res[2048];