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 endThis 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement