Hi, I'm working on 'export image' by myself and the result was not bad.
Now, I'm trying to export some images with different name. The problem is, I already set up the specific name. I couldn't get next image with different name before I change the name in code.
Maybe, I have to treat the name as variable but don't know how to do
could you please help me with it? Here, I'm sharing the code
require 'sketchup.rb'
def exportimage
model = Sketchup.active_model
entities = model.entities
view = model.active_view
# Set the camera properties
eye = [0, 0, -1000]
target = [0, 0, 0]
up = [0, 100, 0]
# Create the camera and make it active
cam = Sketchup;;Camera.new eye, target, up
view.camera = cam
view.zoom_extents
# Set file property
keys = {
# Naming file
;filename => "c;/temp/_image.png",
# Pixel setting
;width => 500,
;height => 500,
# Tranparent setting
;transparent => false
}
view.write_image keys
end # def ExportImage
#-----------------------------------------------------------------------------
if( not file_loaded?("exportimage.rb") )
add_separator_to_menu("Plugins")
if $submenu!=nil
$submenu.add_item("ExportImage") { exportimage }
else
UI.menu("Plugins").add_item("ExportImage") { exportimage }
end
end
#-----------------------------------------------------------------------------
file_loaded("exportimage.rb")
with the code. All the name of images I produced was '_image'. I would like to get images have different name without changing the line "c:/temp/_image.png",
in the code.