Ruby 如何以编程方式为Sketchup中的页面设置摄影机?

Ruby 如何以编程方式为Sketchup中的页面设置摄影机?,ruby,sketchup,Ruby,Sketchup,我刚开始写Sketchup插件,我遇到了问题。我知道如何创建页面(场景)和摄影机,但不知道如何为页面设置摄影机。有什么建议吗 eye = [100, 100, 500] target = [300, 300, 300] up = [0, 0, 1] pg_front = pages.add "front" front_cam = Sketchup::Camera.new eye, target, up # First idea, but it's not working pg_front.c

我刚开始写Sketchup插件,我遇到了问题。我知道如何创建页面(场景)和摄影机,但不知道如何为页面设置摄影机。有什么建议吗

eye = [100, 100, 500]
target = [300, 300, 300]
up = [0, 0, 1]

pg_front = pages.add "front"
front_cam = Sketchup::Camera.new eye, target, up

# First idea, but it's not working
pg_front.camera = front_cam

# Second idea, but it's not working too
pg_front.use_camera = front_cam
你试过使用吗

我对Sketchup知之甚少,但您可能需要在之后更新页面:

pg_front.update(1)
根据文档,以下更新标志可用:

- 1 - Camera Location,
- 2 - Drawing Style,
- 4 - Shadow Settings,
- 8 - Axes Location,
- 16 - Hidden Geometry,
- 32 - Visible Layers,
- 64 - Active Section Planes.
如果这不起作用,请在重新分配之前尝试禁用相机,然后再次启用它(
pg\u front.use\u camera=true/false

- 1 - Camera Location,
- 2 - Drawing Style,
- 4 - Shadow Settings,
- 8 - Axes Location,
- 16 - Hidden Geometry,
- 32 - Visible Layers,
- 64 - Active Section Planes.