ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Lengths over trigonometric

    3
    0 Votes
    3 Posts
    202 Views
    TIGT
    This is pretty basic 'trigonometry'... [Should have listened more carefully in class ] The ' opposite_side' of a right-angled triangle is found by adjacent_side * Math::tan(angle) The 'angle' needs to be in radians, so if you have it in degrees then you need to use angle.degrees There are similar equations for finding the other sides depending on the known angles/sides etc... There are many Internet sites giving advice...
  • Web dialog pass data from Ruby to webdialog

    6
    0 Votes
    6 Posts
    2k Views
    A
    That is because you "kill" the document when you do document.write(query). Look at the documentation of document.write. This works: @name = "the name" @description = "the description" dialog = UI;;WebDialog.new("Details", true, "sachi_pluginname_dialogname", 410, 875, 1030, 0, true) dialog.add_action_callback("pass_data") { |dialog, htmlpage| js = "set_details(#{@name.inspect}, #{@description.inspect})" # It's not java. dialog.execute_script(js) } dialog.set_file 'C;\Program Files\Google\Google SketchUp 8\Plugins\set_id\details.html' dialog.show() <html> <head> <script> function callRuby(htmlpage) { // Declare the variable with "var" so that it is not global. var query = 'skp;pass_data@' + htmlpage; window.location.href = query; } function set_details(a, b){alert(a); // Example 1 var text = document.createTextNode(a); document.getElementById("detail1").appendChild(text); // Alternative // document.getElementById("detail1").innerHTML = a; // Example 2 document.getElementById("detail2").value = b; } </script> </head> <body> <div id="detail1"></div> <input id="detail2" /> </body> <script> // If you will access element in the page, you need to do this after the page (body) has loaded. callRuby("pull_selection_count"); </script> </html>
  • How to add multiple groups into one group?

    18
    0 Votes
    18 Posts
    520 Views
    nithi09N
    Hope this explains my requirement a little better. I have a sunroom comprised of many groups: corner post, floor channel, door, window etc. I want the user to select their sunroom color by clicking the model. In order to do this I need to gather all the sunroom groups into a parent group where I will use the onClick function to change the Material attribute. I expect the Material change will automatically cascade to the sub-groups but if not I can easily set the Material of the sub-groups to something like=Parent!Material The question is how do I wrap all of my groups into this parent group? Thom Thom thank you for the advice regarding start opertaion, but I do not need undo for this model, the user is starting with a blank canvas and will simply delete top level group if they have to start over
  • Get attribute roty

    11
    0 Votes
    11 Posts
    630 Views
    existmeE
    I wonder if you had find an answer to your problem, I also need to know the value of lenY but I cannot get it through get_attribute with out entering them manually in dc panel
  • Drop-Down List Options

    18
    0 Votes
    18 Posts
    1k Views
    pingpinkP
    Maybe,the problem is about the component , and face color functions . I did it separately in the external files. My webdialog have to be chosen all options and run by clicking. I'm trying to develop the curtain wall structure modeling .I'm not finished all the codes yet. I use Window , and SU7 to test a program. I changed all the color_value names which you suggest it would cause the conflict about component's color and face's color. It's looked easier in the code. I've attached the files for you If you would like too see. And If you have any suggestions , I love to read for improvement. Thank you for helping and teaching me ,Jolran .I keep doing codes every day.I'm trying !
  • [Doc] Official LanguageHandler Docs

    2
    0 Votes
    2 Posts
    143 Views
    A
    That's the end. Once it's an official API they won't fix/rename/add what has been urgently requested.
  • Reference to deleted Group

    9
    0 Votes
    9 Posts
    388 Views
    J
    Following this conversation I realized I am doing something Sketchup was not meant to do, So I switched to rotating points instead of edges, and rotate them one by one instead of in a group. I still need to keep references to the points (not to the edges), but so far it looks OK. Thank you
  • Understanding overlayed transparent OpenGL polygons

    9
    0 Votes
    9 Posts
    1k Views
    thomthomT
    @aerilius said: The best (nicer) but it seems only to affect pngs. The example should be fully working. Do you see the same phenomenon? I see the same on my nVidia 8800GT card. (SU8)
  • What does SketchUp 2013 do for developers?

    44
    0 Votes
    44 Posts
    8k Views
    thomthomT
    @dacastror said: when opening sketchup 8 will not get a notice to upgrade to 2013 version (because of this, they will lose millions of users) It does update. Unless you have a firewall that blocks access. @dacastror said: in "Sketchup 2013 free" entities transformations performed more slowly than "Sketchup 2013 pro" and "Sketchup 8". These things are really serious errors Got a reproducible sample case for this?
  • This method of apply color working?

    14
    0 Votes
    14 Posts
    430 Views
    TIGT
    That was and is displayed. But it think the string equivalent was always shown but just didn't work until now
  • DC Custom Function - Sum of attribute values

    4
    0 Votes
    4 Posts
    705 Views
    TommyKT
    I have rewritten the plugin to add up the attribute values as it recursively looks through the components and groups. This works without a problem. For future reference, all those people out there dealing with dynamic attributes should probably know that something weird happens when you create an array of nested groups/components and start working on them within the DCFunctionsV1 class. That may be an incorrect diagnosis, but it explains enough for my situation. For those interested, see the plugin attached that works. At the moment, when you change the value of an attribute of a nested group/component that is summed, it doesn't automatically update the formula value. Fixing this is my next challenge. Oh what fun I will have with observer classes (of which I know very little about)! AttributeSum v0.1
  • Ruby script for selecting color

    62
    0 Votes
    62 Posts
    2k Views
    nithi09N
    Hi TIG I figure it out how to write animate. but I have a another question How do I make one group from bunch of small groups for example house has door group, window group, roof group (I mean door(),window(),roof()). now how do I do these three method in to one group? I need to make house group contain door group, window group, roof group. I search whole forum I could not find close to my situation. pls give me some Idea thanks
  • Cleanup Old Plugin Versions?

    10
    0 Votes
    10 Posts
    622 Views
    TIGT
    If you read the code it never said that. It said: self.delete_folder(File.join(File.dirname(File.dirname(__FILE__)), 'K2WS'))Assuming that the rb doing the deletion is in the K2WS_Comp2LayerScene_ext subfolder. The path finds the dirname of its folder and then the dirname of that folder's folder - which should typically be Plugins...
  • WebDialog vs. Win7/IE10 problem

    9
    0 Votes
    9 Posts
    466 Views
    thomthomT
    Yes, modal webdialogs under Windows are working as modal windows should. For some odd reason it's not working as a modal window under OSX.
  • Game running half the speed in SU 2013 vs SU 8

    27
    0 Votes
    27 Posts
    943 Views
    A
    @renderiza said: SketchUp 8 runs little bit faster still but not by much...I will study ways of optimizing code to make it faster but as is right now it is playable. Sounds great, I will be the tester @chris fullmer said: Awesome, glad its improved! Thanks for working that into his code Anton, great! It was interesting, I never actually knew that setting the second parameter of model.start_operation to true would actually improve the performance. That is an important parameter to know, especially when your dealing with geometry plugins.
  • Find Group name

    6
    0 Votes
    6 Posts
    271 Views
    H
    I find a way. # {Ecken von ausgewaehlten Elementen ermitteln() # def ecken_ermitteln model = Sketchup.active_model entities = model.active_entities auswahl = model.selection context = auswahl.first MoMo;;g_name = context.name MoMo;;teile = entities.add_group auswahl model.selection.add(MoMo;;teile) auswahl = model.selection e = auswahl.at(0) bounds_a = e.bounds MoMo;;x_mass = bounds_a.width MoMo;;y_mass = bounds_a.height MoMo;;z_mass = bounds_a.depth MoMo;;i_li = bounds_a.corner(2)[0] if MoMo;;tuer_c_o_li == 0 MoMo;;i_re = bounds_a.corner(3)[0] if MoMo;;tuer_c_o_re == 0 # corner(n) = # 0 = [0, 0, 0] (left front bottom) # 1 = [1, 0, 0] (right front bottom) # 2 = [0, 1, 0] (left back bottom) # 3 = [1, 1, 0] (right back bottom) # 4 = [0, 0, 1] (left front top) # 5 = [1, 0, 1] (right front top) # 6 = [0, 1, 1] (left back top) # 7 = [1, 1, 1] (right back top) end # {S-Tuer oeffnen/schliessen() # def schiebetuer_open_close_li_gen model = Sketchup.active_model entities = model.active_entities status = ecken_ermitteln # siehe oben if MoMo;;g_name == 'Schiebetuer_li' x2 = MoMo;;x_mass / 3 * 2 x1 = x2 if MoMo;;tuer_c_o_li == 0 x1 = -x2 if MoMo;;tuer_c_o_li == 1 a1 = 0 if MoMo;;tuer_c_o_li == 0 a2 = 1 if MoMo;;tuer_c_o_li == 1 t1 = Geom;;Transformation.translation [x1,0,0] entities.transform_entities t1, MoMo;;teile MoMo;;tuer_c_o_li = 1 if a1 == 0 MoMo;;tuer_c_o_li = 0 if a2 == 1 else UI.messagebox 'Es wurde eine falsche Tuer ausgewaehlt.' end status = MoMo;;teile.explode end def schiebetuer_open_close_re_gen model = Sketchup.active_model entities = model.active_entities status = ecken_ermitteln # siehe oben if MoMo;;g_name == 'Schiebetuer_re' x2 = MoMo;;x_mass / 3 * 2 x1 = -x2 if MoMo;;tuer_c_o_re == 0 x1 = x2 if MoMo;;tuer_c_o_re == 1 a1 = 0 if MoMo;;tuer_c_o_re == 0 a2 = 1 if MoMo;;tuer_c_o_re == 1 t1 = Geom;;Transformation.translation [x1,0,0] entities.transform_entities t1, MoMo;;teile MoMo;;tuer_c_o_re = 1 if a1 == 0 MoMo;;tuer_c_o_re = 0 if a2 == 1 else UI.messagebox 'Es wurde eine falsche Tuer ausgewaehlt.' end status = MoMo;;teile.explode end
  • Sound Effecs in SketchUp (HELP)

    31
    0 Votes
    31 Posts
    6k Views
    renderizaR
    Hi, Its been long time since I talked about this but I want to share some new information regarding sound. My initial goal was to trigger same sound simultaneously and have the ability to overlap sounds without any cutoffs or lag. Just recently I learned how to make use of HTML5 by adding a the following line on web-dialog <meta http-equiv="X-UA-Compatible" content="IE=10"> and this has opened a lot of possibilities with sound. Here is a technique that will enable multiple sounds... On HTML <audio src="sound.mp3" id="snd_test1" preload> On Javascript document.getElementById("snd_test1").cloneNode(true).play() Note: The above line of code is used every time you want to trigger sound. Also for me the only type of sound extension that is working is mp3...I have tested .swf and .wav so far. If anyone has any new info about sound and SketchUp please post it here...Cheers!
  • How to check syntax without executing

    8
    0 Votes
    8 Posts
    431 Views
    thomthomT
    catch was supposed to be rescue in my snippet. I was language confused. :s
  • The Naming of Groups (API issues)

    11
    0 Votes
    11 Posts
    848 Views
    fredo6F
    @richmorin said: @jolran said: Hope this can help you (although it's related to modifying geometry in groups): http://sketchucation.com/forums/viewtopic.php?f=180&t=52014&view=unread#p470425 Yes, that was very interesting. Thanks for the pointer (though it didn't make me feel any better about the situation): "It's worse than that — he's dead, Jim!" Sigh. -r Groups should be unique and not treated as components with multiple instances when freshly copied. This is causing so much trouble for scripts! and probably the source of numerous crashes. Regarding group names, I think the SU implementation is that the name is just an attribute. The identification is done internally based on Ids of the underlying definitions. If we wanted that all groups are created with a unique name, then I am afraid that this is a request for the SU team to modify the core. Of course, a script that will make all name unique can be written, but you would have to run it every time you create a new group. Fredo
  • Possible or Impossible? (or post your favourite jQuery..)

    20
    0 Votes
    20 Posts
    567 Views
    thomthomT
    best_picked - or best_face if you want to avoid getting an edge or group or whatnot. Yea, I've spent a lot of time testing things. The API docs are much better now then in 2007 when I started, but it's still lacking details.

Advertisement