It's a new feature of SU2015 BTW?
Posts
-
Raise left click
I have read all posts related to Section_Plane and understand that, at now, the APIs doesn't permit to use in a USEFULL way a Section_Plane (only create and show) but not to ACTIVATE and thus "visually slice" the model.
So, turning back to the "old way", i.e. use the Section Tool (via a Skecthup.send_action for example?) would be a possible trick?
My question is: is there a way to position the Section_Plane via this approach? To be more precise, is it possible to "emulate a left click" via APIs? -
[Solved] WedDialog- how to debug?
Is there any way in order to get the console.log directly from a webdialog? Redirect to a file for example is a feasible way?
EDIT [Solution]: Just use the mechanism Ruby <==> WebDialog.....and substitute every console.log with your new function....
[HTML]
var callRubyCONSOLELOG = function(data) { query = 'skp;sendMessage2CONSOLELOG@' + data; window.location.href = query; }
[RUBY]
myWebDialog.add_action_callback("skp;sendMessage2CONSOLELOG") do |web_dialog, message| puts(message) end
-
Linear Algebra & Analytic Geometry
Hi Guys, I have an agony-problem with a 3D rotation.
Suppose to have a face placed generically in space, with its normal vectorv = [vx,vy,vz]
How you could rotate this face in order to put is for example in the XY plane (or anywhere else)?
-
RE: Webdialog and ActiveXObject
mmmmm...it's a very long task....
Does .get_element_value works with every DOM elements orr only with input-type?why I can't pass the whole page as string?
-
RE: Webdialog and ActiveXObject
Ok. I think I'm on the road....but I have at the moment a difficulties with the .add_action_callback
dlgRESULTS.add_action_callback("exportHTML") { |web_dialog, params| begin UI.messagebox("NO ERROR") UI.messagebox(params.to_s) rescue UI.messagebox("ERROR") end }
while in my javascript file
var exportHTML = function(actionName) { query = 'skp;exportHTML@' + actionName.toString(); alert(query) window.location = query; } strHTML = "<html>" + $("html").html() + "</html>" // leggiHTML returns the whole page exportHTML(strHTML.toString())
but this approach doesn't work....I suppose that it's due to the "strHTML" string...may be because it isn't passsed as string but as other type? I can't get any error or warning....I can't understand....
-
RE: Webdialog and ActiveXObject
I want to save the webdialog content (in a firt moment I load an html template with tables and then I change its conents via jquery) in several format (WORD, EXCEL, PDF, HTML).
I'm thinkin to send the html content of the page back to SU and the use Ruby to export in those fortmats....
-
Webdialog and ActiveXObject
I want to use some ActiveXObject features...it seems that IE has window.ActiveXObject but creating a new Word.Application is impossibile.... do you know something about this stuff?
-
RE: [Plugin] Gradientator v1.21
In SketchUp 2015 I get the following error after the install:
Error: #<SyntaxError: C:/Users/nessuno/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/gradientator.rb:79: formal argument cannot be an instance variable
...ck("get_data") do |@grad_dialog, action_name|... ^>
C:/Users/nessuno/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/rubytoolbar/rubytoolbar.rb:144:inload' C:/Users/nessuno/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/rubytoolbar/rubytoolbar.rb:144:in
rt_load'
C:/Users/nessuno/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/rubytoolbar/rubytoolbar.rb:190:inblock in <module:RubyToolbar>' SketchUp:1:in
call'I solved changing row 79 to the end of the do block in this way
@grad_dialog.add_action_callback("get_data") do |grad_dialog, action_name| if action_name == "begin_gradientating" @grad_dialog = grad_dialog @coloronename = @grad_dialog.get_element_value("color_one_name") @colortwoname = @grad_dialog.get_element_value("color_two_name") @colorthreename = @grad_dialog.get_element_value("color_three_name") @grad_dialog.close gradientate(@coloronename,@colortwoname,@colorthreename,@faces,@model) end if action_name == "close_this_window" @grad_dialog.close end end
-
RE: Tool: getMenu and toolbar
Good. So suppose that I have:
- myGUI.html
- myPLUGIN.rb
- myTool.rb (that have the nested modules: BomaStudio and BomaTool)
From myPlugin.rb I want to show myGUI.html, set some values and than run myTool.rb.
Inside the myPlugin.rb file I have to embed all code inside the BomaStudio modules? -
RE: Tool: getMenu and toolbar
Yes it do the work!! But only after I changed all my class variables to module variables (I can't understand the reason...).
Dan you are a very amazingly competent developer. I can only whish to reach in the future a half of your skills!!!!
P.S.: I saw that you nested in the code of your post two modules:
module BomaStudio
and
module CustomTool
. Is there a specific reason to do so?
-
Tool: getMenu and toolbar
A new trip is firing me... In a tool (alongside the activate, deactivate, draw etc methods) there's the getMenu one. But it is intended to work with contextmenu. I'm trying to implement it in order to get a floating toolbar and it works but only the first time! If I select another tool and the reselect my Tool it doesn't work anymore.... I'm going crazy!!!
def creaTOOLBAR(view) puts view @tbTOOL1= UI;;Toolbar.new("Tool1") @cmdTOOL1= UI;;Command.new("Tool1") {tool1("Right", view)} @cmdTOOL1.large_icon = Sketchup;;find_support_file("muroDX_40x40.png", "Plugins/TECLA_STRUCTURE/icone/") if @tbTOOL1.length==0 #evita di aggiungere continuamente le 3 icone alla toolbar @tbTOOL1.add_item @cmdTOOL1 end # view.invalidate # @tbTOOL1.show() if !@tbTOOL1.visible? end def tool1(side, view) @side = side # view.invalidate # IF ENABLED HERE I GET; Error; #<NoMethodError; undefined method `invalidate' for nil;NilClass> # IF DISABLED NOTHING HAPPENS end
-
RE: Toolbar position
A lot of things to study..... many thanks Dan....you are a GURU!!!
-
RE: Toolbar position
OK. Could you give some more info about the Windows trick? MAC users aren't in my plan for the next year....
-
Toolbar position
Dou you know any way to show a new toolbar near the mouse arrow position?
-
RE: Deleting Component Instance
Guys you are and invaluable support for SU developers.... a beer to all of you!!!
-
Deleting Component Instance
Hi guys. I'm inserting into my model two Component
pants_path1 = Sketchup.find_support_file("myCOMPO1.skp" ,"Plugins") pants_def1 = Skecthup.active_model.definitions.load(pants_path1) pG1 = Geom;;Ponit3d.new(0,0,5) transform1 = Geom;;Transformation.new(pG1) compo1 = @entities.add_instance(pants_def1, transform1) compo1.name="Name1" compo1.locked = true
and similarly for the 2nd Component
pants_path2 = Sketchup.find_support_file("myCOMPO2.skp" ,"Plugins") pants_def2 = Skecthup.active_model.definitions.load(pants_path2) pG2 = Geom;;Ponit3d.new(0,0,10) transform2 = Geom;;Transformation.new(pG2) compo2 = @entities.add_instance(pants_def2, transform2) compo2.name="Name2" compo2.locked = true
If, in a separate function, I try to delete those Components through an iteration I get a Error: #<TypeError: reference to deleted Entity>.
def eraseCompo() Sketchup.active_model.active_entities.each{|e| if e.typename=="ComponentInstance" if e.name=="Name1" or e.name=="Name2" Sketchup.active_model.erase_entities(e) end end }
What I'm missing?
-
Edge.all_connected to curve
How to convert all connected edges to curve?
I think to retrieve all vertices and create a new entity .....
entities.add_curve(pts)
But I need to have an ordered array of vertices....
-
RE: SketchUp and Rubies on Linux (yes, it works)
@aerilius said:
In the meantime Wine has reached a state where SketchUp can be used without Microsoft's Internet Explorer, but with Wine's own opensource Internet Explorer replacement that is based on Firefox/Gecko.
This means we can have all the goodness of Gecko in WebDialogs!
[attachment=0:3k7jewnp]<!-- ia0 -->wine-explorer.png<!-- ia0 -->[/attachment:3k7jewnp]How to force to use Gecko instead of IE?