You can use dxf_dim() : create an extra layer in your dxf, for example. "dimensions", draw a horizontal and vertical dimension line with max. width respectively. Max. height, as described in the Documentation , as an identifier, for example. "TotalWidth" and "TotalHeight", here is my test picture as an example:

get values โโusing:
tw = dxf_dim(file="bahtinov.dxf", name="TotalWidth", layer="dimensions", scale=1); th = dxf_dim(file="bahtinov.dxf", name="TotalHeight", layer="dimensions", scale=1);
scale part:
scale([130/tw,130/th,1]) linear_extrude(height = 5, center = true) import(file="bahtinov.dxf", layer="layerName", scale=1);
source share