Thanks Rick and Jim that helped!
Posts made by Dhruv
-
RE: Changing scenes from Ruby
Here is the corrected part of javascript. But still I am facing the same problem. Actually that was a typo in my previous post.
<input type="button" onclick="callRuby('selected_page') value ="Scene1">Β
<input type="button" onclick="callRuby('pages1.selected_page') value = "Scene2">Β
<input type="button" onclick="callRuby('pages2.selected_page')" value="Scene 3"> -
Changing scenes from Ruby
**What I am trying to do,
I am trying to change scenes through web-dialogue, Inside web dialogue I have buttons upon which clicken on , scenes will change.
Here is part of my ruby code.**
@@xzybit_dlg.add_action_callback("get_data") do |web_dialog,action_name|
if action_name=="selected_page"
#For scene 1
pages = Sketchup.active_model.pages
pages.selected_page = pages["Scene 1"]
#js_command = "passFromRubyToJavascript("+ selected_page.to_s + ")"
web_dialog.execute_script(js_command)
end# For scene 2 if action_name="selected_page" pages1 = Sketchup.active_model.pages pages1.selected_page = pages1["Scene 2"] #js_command = "passFromRubyToJavascript("+ selected_page.to_s + ")" web_dialog.execute_script(js_command) end # For scene 3 , bug for now, it goes to scene 2 when clicked upon scene 3 if action_name="selected_page" pages2 = Sketchup.active_model.pages pages2.selected_page = pages2["Scene 3"] #js_command = "passFromRubyToJavascript("+ selected_page.to_s + ")" web_dialog.execute_script(js_command) end end
Here is part of my javascript code
function callRuby(actionName) {
query = 'skp:get_data@' + actionName;
window.location.href = query;
}
<input type="button" onclick="callRuby('selected_page')">Β
<input type="button" onclick="callRuby('pages1.selected_page')">Β
<input type="button" onclick="callRuby('pages2.selected_page')" value="Scene 3">scene 1 and 2 are working fine. But when I click on Scene 3 it goes to scene 2 and not scene 3, which needs to be fixed.
Thank you,
Dhruv -
RE: User defined DC functions
I am trying to open a hyperlink basically, when user clicks I want it to direct to web-browser.
-
RE: User defined DC functions
Can you show me how do I use imageURL with onClick function?
Thanks a lot!
Dhruv -
RE: User defined DC functions
Hey Remus,
Can you show me a example? That would be really helpful!
-
RE: User defined functions
or can I have something like this, when I leftclick on any object, it opens a webdialog?
-
RE: User defined DC functions
There is one links.rb plugin , which does open url but thats by right clicking on an object , but I want left clicking. What I am trying to say is that you can set links from before through DC function like onClick(" window.open("www.google.com")"); something like this. There is no threat in this. All I am asking that I want objects to act as hyperlinks. I am just trying to figure out ,how to implement it through dc components?
-
RE: Component Attributes - ImageURL
I wanted to know one thing, can I define my onClick openURL function in DC? Can I define my own functions in DC? if so where do I do it? I don't know whether image URL does the same thing. Can somebody clarify it?
Something like userdefined function.Thanks,
Dhruv -
RE: Question about dynamic component
I wanted to know one thing, can I define my onClick openURL function in DC? Can I define my own functions in DC? if so where do I do it? I don't know whether image URL does the same thing. Can somebody clarify it?
Something like userdefined function.Thanks,
Dhruv -
RE: Some DC requests - others?
I wanted to know one thing, can I define my onClick openURL function in DC? Can I define my own functions in DC? if so where do I do it? I don't know whether image URL does the same thing. Can somebody clarify it?
Something like userdefined function.Thanks,
Dhruv -
User defined DC functions
I wanted to know one thing, can I define my onClick openURL function in DC? Can I define my own functions in DC? if so where do I do it? I don't whether imageURL does the same thing. Can somebody please clarify this?
Thanks,
Dhruv -
User defined functions
I wanted to know one thing, can I define my onClick openURL function in DC? Can I define my own functions in DC? if so where do I do it?
Thanks,
Dhruv -
RE: Sketchup game
Well I asked him and he told me to post it on forums. I guess he must be busy , he told me that you will have to create your own ruby script and I just started learning ruby.
-
Sketchup game
I am building my own code over Prince IO game tht Scott released before few days.
At the moment I want to do two things
- How can I load different .skp files to my game from webdialogue?(I want to do this cause I dont want to go every time to drop down menu from plugins and load the map)
- How can I open a web - browser by left clicking on the model? (Something like onclick function from maybe dynamic components)
Thank you,
Dhruv Adhia -
RE: Prince IO Sketchup Game Demo
Hey Coen Naninck,
I wanted to do something related to Dynamic components, like when you click on an object/model, it brings to some website. Like lets say I have built a Kawasaki motor bike , when I left click on it brings me to some kawasaki website online.
Will try out though, see if I can come out with this feature. It would be cool to use it in a game.
Cheers,
Dhruv -
RE: Prince IO Sketchup Game Demo
I made it run along Y axis as well, it was a little change and assigned J and S for jump and Swordhit respectively. Arrow keys for direction. Ill try and add more features.
Cheers,
Dhruv