RemapCplane

Hi,

In the help of Python: RemapObjects - NOT IMPLEMENTED IN PYTHON YET

How do I transform an object (planar) from let’s say world yz to world yx?

-Thomas

hmm got something going here, but the Y-ax seems to flip:
edit: it rotates of course…

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino




def Transform():
    msg="Select objects.."
    objs=rs.GetObjects(msg,8,preselect=True)
    if not objs: return
    
    for obj in objs:
        xform=rs.XformRotation1(rs.WorldYZPlane(),rs.WorldXYPlane())
        rs.TransformObjects(obj,xform,copy=False)
Transform()

This seems to work here:

import rhinoscriptsyntax as rs

def RemapObjects():
    objects = rs.GetObjects("Select objects to remap", rs.filter.allobjects, True)
    if objects:
        initial_plane = rs.ViewCPlane("Top")
        final_plane = rs.ViewCPlane("Front")
        xform = rs.XformRotation1(initial_plane, final_plane)
        rs.TransformObjects(objects, xform, False)

RemapObjects()

Thanks!

Another question: When I use copy=True, how do I select the new objects?

copies=rs.TransformObjects(objects, xform, True)

–Mitch