Hi All,
How to write image for standard camera views in Sketchup using Ruby?
Here is my code:
view = Sketchup.active_model.active_view
if val == 1
@name = "Top View"
view.camera = Sketchup.send_action('viewTop:')
elsif val == 4
@name = "Right View"
view.camera = Sketchup.send_action('RightTop:')
elsif val == 5
@name = "Front View"
view.camera = Sketchup.send_action('FrontTop:')
end
#eye = [1000,1000,1000]
#target = [0, 0, 0]
#up = [0, 0, 1]
#cam = Sketchup::Camera.new eye, target, up
keys = {
:filename => "C:/Users/Admin/Desktop/Images/#{@name}.png",
:width => 640,
:height => 480,
:antialias => false,
:compression => 0.9,
:transparent => true
}
view.write_image keys
I have tried to wite images for standard camera views If anyone known the solutions please let me know.
Thanks,
Siva S