Hello,
I wonder if it is possible to have a macro to select and display a section view. I mean, I have several sections, some named views, some display modes of my own, and my goal is to have a macro (or a script, at the worst) to set some perspective views, get some sections, and write the results to files.
For now I have something like this:
Well, why not? The script is quite simple and primitive, I haven’t had time for working on it, I just need the animation. The idea is just to move a VA section within a defined view, displayed with a defined display mode. And there are some “manual” variables, like a section depth (I would like to get it from a section definition), step (this is a single movement of each section, the smaller step the smoother the animation). So, for now it looks like this:
import rhinoscriptsyntax as rs
alias = "VC1"
section_name = "ANIMACJA-PRZEKROJ-B"
section_depth = 64000
step_depth = 320
steps = int(section_depth/step_depth)
start_point = (0,0,0)
end_point = (0,-step_depth,0)
section_movement = rs.VectorAdd(start_point, end_point)
def animacja():
section = rs.ObjectsByName(section_name, True)
for step in range(steps):
rs.MoveObject(section, section_movement)
rs.Command(alias + ' _Enter')
if __name__ == "__main__":
animacja()
The “alias” variable is just an alias as I thought it was the simplest way to get what I wanted. I have several VCs aliases, differing only in scale of captured view. So, VC1 looks like this: