Question:small_icon = and large_icon= method of UI::Command
-
if( not $terrain_CreateFromContours_loaded ) cmd = UI;;Command.new($tStrings.GetString("From Contours")) { Sketchup;;active_model.select_tool FromContoursTool.new } cmd.small_icon = "Images/tbContoursSmall.png" cmd.large_icon = "Images/tbContoursLarge.png" cmd.tooltip = $tStrings.GetString("From Contours") cmd.status_bar_text = $tStrings.GetString("Create a Sandbox from contours") cmd.menu_text = $tStrings.GetString("From Contours") $draw_terrain_submenu.add_item(cmd) tb.add_item(cmd) $terrain_CreateFromContours_loaded = true end
This is a section of code in "sandboxmenus.rb" file.
It works well!
But,I do't understand this line
small_icon = "Images/tbContoursSmall.png"
Both the "images" folder and it‘s upper folder,"Sandbox", are not in the searching path!
How could Sketchup find the img file?
Does sketchup find file in every sub folder in searching path? -
I think it's because the path is taken relative to the path of the calling script's folder. Since script is in a folder that contains the images/... folder. then it is found OK...
-
@tig said:
I think it's because the path is taken relative to the path of the calling script's folder. Since script is in a folder that contains the images/... folder. then it is found OK...
unless the script has been scrambled, in which case the relative path no longer works and you need to use the full path to the images.
Advertisement