I exported some layouts from autocad into rhino. Because they were layouts, I needed to scale them up in model space so I can work in rhino layouts as I would normally. When I scale them up, naturally the dims scale up too. I’m trying not to recreate the dimensions, anyway I can scale these up (without exploding the dimensions) and keep the value so I can change space into the layout, once at scale? @mary
I have this script that sets layout dimensions to match the scale of a viewport if that helps.
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
def set_dim_scale():
def dim_filter(obj, geo, ci): return rs.IsDimension(obj)
dims = rs.GetObjects("Dimension objects", preselect=True, custom_filter="dim_filter")
if not dims:
print("Cancel")
return
detail = rs.GetObject("Detail to match", filter=32768)
if not detail:
detail_scale = 1
else:
detail_scale = rs.DetailScale(detail)
for dim in dims:
try:
obj = sc.doc.Objects.Find(dim)
geo = obj.Geometry
geo.DistanceScale = 1/detail_scale
obj.CommitChanges()
except:
pass
if __name__ == "__main__":
set_dim_scale()
Hi @zale_orcid
You can plan your Rhino model better for export to DWG and import into AutoCAD.
What to know:
- AutoCAD is unitless.
- The assumed base unit for Architectural display is inches in AutoCAD.
So if your model in Rhino with a base unit of Feet, you will not need to convert the Feet unit to Inches, after you import to AutoCAD. This can be a lot of work with layouts and annotations.
If you avoid using Feet in Rhino, you will be able to export to DWG with less edits when you get it into AutoCAD.
See this white paper that explains the recommended workflow from Rhino to AutoCAD.
Sincerely,
Mary Ann Fugier
It sounded like the op was converting the other direction (AutoCAD to Rhino).
Ture, but worth talking about the reasons and issues when you import from AutoCAD / export to AutoCAD from Rhino.
General approach, keep the unit as inches in Rhino, then there will be less work when importing and exporting DXF/DWG.
I’ll see if i can get this to work, any instructions?
Hi @Measure can you help me to understand how to run this script?
@Measure it did not change the dimension…