Webdialog and active_model
-
I've searched but don't seem to get the right info.
I have a webdialog where i set parameters and press a button to update
the active_model. Currently I just draw a box.
The Webdialog stays active, so you can change the settings again.
The problem is that unless I select the active model window(using the
mouse) the drawing does not appear. It seems becuase I am drawing to
active-model, but active-model is "inactive" while I am on the
webdialog, the drawing happens in the background.
I call the followingcomponent = Sketchup.active_model.definitions.add("MyLeftSide") trans = Geom;;Transformation.new instance = Sketchup.active_model.active_entities.add_instance(component, trans) newface = component.entities.add_face(@p) ; # returns a Face newface.reverse! if newface.normal.z < 0 ; # flip face to up if facing down newface.pushpull(@height) ; # extrude it up to make a cube
where @p is an array of points. The code basically works and draws the
correct block, but just not while the WebDialog is the active window!
So little help on using the webdialog stuff. Anybody? -
try adding this after pushpull command :
Sketchup.active_model.active_view.invalidate
-
Thanks
It works like a charm!
-
Hi,
I would be glad to get an overview of your code because I think it could help me with my last post.
Would you be ready to your rb file here?
Thanks!
-
Confitex
Sorry, But I cannot post the ruby code here. It is done for a customer and at this stage it is aimed and giving them something not really available. Cannot give away their business edge
I am willing to answer questions about specifics, like in your post about webdialog and SU parameters. To obfuscate the whole ruby script, and still keep it as working will be a "big" task.
What are you having problems with, or what specifically do need help with?
-
Hello Koos,
I understand your concern about publishing your code.
I'm sure you can help me in my other post.
http://www.sketchucation.com/forums/scf/viewtopic.php?f=57&t=6543&p=41849#p41849
Maybe you could have a look there and put me on the rails?I'v solved some of my problems nut still have no idea how to put more text boxes in my form and retrieve each single variable into sketchup.
I feel this :
dlg.add_action_callback("ValueChanged") {|d,p| $avariable = p }
is to short to do so because i can retrieve just one varaiable. Isn't it?
Do not hesitate to reply in the other post so that I can end this one.Thank you Koos.
Advertisement