Get size of mapping

Hello!
Is it possible get this sizes from python code?


Thank you!

Hi @akushnir,

if your picture is showing a set of UV-unwrapped meshes the dimensions marked in red depend on the UV-Rectangle you’ve picked. You could get the dimensions by creating a bounding box with rs.BoundingBox() and measuring the returned point distances. Example:

import rhinoscriptsyntax as rs

def DoSomething():
    
    # get uv meshes
    mesh_ids = rs.GetObjects("Select UV-Islands", 32, True, True, False)
    if not mesh_ids: return
    
    # get width and height from bounding box 
    bbox = rs.BoundingBox(mesh_ids)
    if bbox:
        w = rs.Distance(bbox[0], bbox[1])
        h = rs.Distance(bbox[1], bbox[2])
        print "W={} H={}".format(w,h)
        
DoSomething()

Does that help ?
_
c.