Create Standard Views creates seven standard view cameras: front, back, top, bottom, left, right, and isometric. At the end of the article, you will find the annotated script code for your reference.
How the script works:
Section 1: Create dictionary variable views and assign a name for each of the seven standard views.You can find more information about the KeyShot standard views here.
Section 2: Create seven cameras with the names defined in Section 1, and then set the right camera angle.
Create a loop that goes through each view name defined in the view variable.
Assign the view name to the name variable.
Create a boolean variable has and set it to "False".
Check if one of the pre-existing cameras already has that name. If it does, set the has variable to "True" and set it's camera to be used for that viewlux.setCamera.
If the camera name does not exist already create a new camera with the right name using lux.newCamera.
Set the right angle for that view using lux.setStandartView.
Save the camera.
Display a status message in the console.
After running the script, you will see your seven standard views saved as cameras in the Project window > Camera tab.