Last active
April 23, 2020 14:19
-
-
Save StepMaher/47b2fb7086297ba30e02a16733449ba4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Gets active Rhino camera. | |
Inputs: | |
A: Set to 'True' to activate current camera. | |
Outputs: | |
S: Starting location. | |
T: Target location. | |
L: Lens length. | |
U: Up. | |
""" | |
ghenv.Component.Name = "Get Camera" | |
ghenv.Component.NickName = 'GetCam' | |
# Import libraries. | |
import Rhino | |
import Grasshopper as gh | |
# Warnings. | |
if not A: | |
msg = "Input parameter 'A' failed to collect data." | |
ghenv.Component.AddRuntimeMessage(gh.Kernel.GH_RuntimeMessageLevel.Warning, msg) | |
if A == True: | |
S = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.CameraLocation | |
T = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.CameraDirection | |
L = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.Camera35mmLensLength | |
U = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.CameraUp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment