Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5791

How to get Cplane coordinates from GetPoint?

$
0
0

@siemen wrote:

When you go to the right view and run this python code, how do you get the Cplane coordinates instead of the World coordinates as it does now?

import Rhino
import rhinoscriptsyntax as rs

def PointCoordinates():
    
    gp = Rhino.Input.Custom.GetPoint()
    gp.SetCommandPrompt("Select point")
    
    while True:
        
        gp.ClearCommandOptions()
        
        get_rc = gp.Get()
        
        if gp.CommandResult()!=Rhino.Commands.Result.Success:
            return gp.CommandResult()
        
        if get_rc==Rhino.Input.GetResult.Point:
            point = gp.Point()
            print point
        if get_rc == Rhino.Input.GetResult.Cancel:
            break
    return Rhino.Commands.Result.Success

if __name__ == "__main__":
    PointCoordinates()

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5791

Trending Articles