⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Crack Versions

    6
    0 Votes
    6 Posts
    9k Views
    PixeroP
    I remember Amrosias Escape Velosity game had a rather fun and different way of getting people to pay. http://www.ambrosiasw.com/games/windows/ You could play the game for free and after a while Captain Hector would fly by asking you to pay for the game. If you continued without paying he would come more frequently and after still a while he would become agressive and start shooting at you. He was also invincible so you could never win a fight with him. (I tried.)
  • Webdialog for a progressBar

    9
    0 Votes
    9 Posts
    1k Views
    G
    Typically I do not use a progress bar. Instead I use Sketchup::set_status_text I'm happy using a counter with a modulus. I generally try to update the status no more than once every second or two. The same idea would work for a progress bar. All I was trying to do is give bomastudio a solution to his request and show him how to get around the problem of the web dialog being starved of cpu time. Without the timer loop you blow the bottom off the stack. With a timer loop you incur a performance penalty. The interesting thing is the jquery ready function would only fire after the heavy processing had finished.
  • Register_extension error

    5
    0 Votes
    5 Posts
    843 Views
    D
    @tig said: If the RB is going to be encrypted use this: ext = SketchupExtension.new(extensionName, "greenspaceLive_gModeller/LiveEnergy-Classes/main") SketchUp automatically finds a matching file RB or RBS... You never mentioned that as a possible scenario... If you have other RB files encrypting in the subfolder[s], then also ensure you use: Sketchup::require(name_without_filetype_suffix) rather than ' load()'... This way the RB files load during testing AND the RBS files still work after the encryption... You have to plan ahead. : Thanks, that should be the only change I need. I was already using encryption but forgot that main.rb was excluded from the encryption on my local copy.
  • Active_path.last original transformation

    10
    0 Votes
    10 Posts
    1k Views
    T
    It is good to do something else. When reading about model observers I have found the answer: Sketchup.active_model.edit_transform There is a mistake in the documentation though: @unknownuser said: ModelObserver.onActivePathChangedSketchUp 7.0+ ... When in "edit mode" (aka a Component is being edited), the Ruby API returns object transformations and locations in context of the "local" component axes instead of the global axes. It is other way round. In "edit mode" we are in global context. If one wants to have the local then use edit_transformation. When you want original transformations for the rest of instances then you have to go through the whole "tree" and use edit_transformation for the last group/component.
  • Determine if edge would split face

    6
    0 Votes
    6 Posts
    1k Views
    G
    Thanks guys - this gives me some good direction. I like Sam's strategy where he makes use of the raytest.
  • Moving a Line or Edge

    3
    0 Votes
    3 Posts
    656 Views
    TIGT
    As Sam says, transformations only apply to containers like component-instances, groups and images. A Point3d does not have a transformation, BUT you can use point.transform!(transformation) it relocate it. Basic entity objects - like vertices, edges and faces - have to be transformed using: objects_parent_entities.transform_entities(a_transformation, [array_of_objects]) this works with any kind of transformation; or for a vector based 'translation': objects_parent_entities.transform_by_vectors([array_of_objects], [array_of_vectors]) note that each object in the first array must have a matching vector in the second array... Also if you are using the these to move say vertices, don't also include some edges or faces which use those vertices - otherwise the vector transformation will be done twice, with unexpected consequences...
  • SketchUp RUBY API Wishlist [way of coding wishes, please]

    107
    0 Votes
    107 Posts
    43k Views
    R
    Hello, I am new to google sketchup with ruby script. I have install google sketchup on my linux machine ubuntu 12.04. now able to start with ruby script. i already have ruby script. SO anyone can help to how can i run this script with google sketchup. Thanks
  • UI.inputbox

    4
    0 Votes
    4 Posts
    666 Views
    M
    I have "chained" 2 UI.inputbox. First inputbox opens another based on the input from the first box. The first box closes once the second is shown.
  • Sketchup.send_action arguments: Mac vs PC

    10
    0 Votes
    10 Posts
    4k Views
    B
    This is an old thread, but I'm adding a tip here that may be of help to other developers who may discover this info... In an effort to create a toolbar button to show the "Entity Info" palette (there's a built-in button for Model Info, but oddly not for Entity Info), I couldn't find a method or action that worked on the Mac. There is a fixnum constant value for the PC, but these don't seem to work on the Mac, even after years of SketchUp evolution on the Mac. Then I stumbled on the get_shortcuts method... Using the "Shortcuts" pane within the "Preferences" window, you can add a shortcut to the command for which you need the string constant, then using: Sketchup.get_shortcuts.sort ...you can discover the string that can successfully be used with the Sketchup.send_action method. For example, I added the F2 key to "Window/Entity Info", and got the following output: Sketchup.get_shortcuts.sort ["A\tselectSelectionTool:", "B\tselectPaintTool:", "C\tselectCircleTool:", "E\tselectEraseTool:", "F\tviewZoomExtents:", "F2\tentityProperties:", "G\tmakeGroup:", "H\tselectDollyTool:", "K\ttoggleDisplayBackEdges:", "L\tselectLineTool:", "O\tselectOrbitTool:", "P\tselectPushPullTool:", "R\tselectRotateTool:", "S\tselectScaleTool:", "T\tselectMeasureTool:", "V\tselectMoveTool:", "Z\tselectZoomTool:", "`\ttoggleHideRestOfModel:", "~\ttoggleHideSimilarComponents:", "⇧G\t/Edit/Context Menu Flyout/Explode"] In there, you'll see "F2\tentityProperties:", so the string constant is "entityProperties:". Voila, a method to discover undocumented action strings.
  • SU7: Sketchup#set_status_text() broken on Mac

    4
    0 Votes
    4 Posts
    870 Views
    SkalpS
    @adamb said: Anyone got any good ideas as to how to get around this bug in SU7? Basically, if you have a Ruby that is working hard and wants to show progress by updating the status text in the lower left, in SU7 on Mac its broken (bug logged SU-0282). Now I guess it will get fixed sometime, but in the meantime I'm trying to find a way of encouraging the window to refresh. A quick demo of what the bug is, is to run the following at the Ruby console: 5.times {Sketchup.set_status_text rand(); sleep 0.5} On PC, it updates the status text, on Mac it only shows the last one when the loop is completed. Any ideas gratefully received! Adam Adam, We have found a solution for this problem. If you put the actions inside a UI.timer, the set_status_text can be updated between the timers. Kind regards, Guy
  • Pickray

    2
    0 Votes
    2 Posts
    791 Views
    thomthomT
    Maybe due to precision issue? Not sure, but you don't have to convert between screenpoints like that: mod = Sketchup.active_model view = mod.active_view ents = mod.entities ents.clear! edges = ents.add_edges([0, 0, 0] , [100, 100, 100]) edge = edges[0] pt1 = edge.start.position pt2 = view.camera.eye Geom.intersect_line_line(edge.line, [pt1, pt2])
  • Localization

    2
    0 Votes
    2 Posts
    672 Views
    D
    I have recently been switching any of mine over to lang_handler... the main reason is concern over the new 'security' measures and where they will go next... I have a plugin that does most the hard work for you, but you still need to do some work... I'll PM it if you want... john
  • Changing Command Icons of the Toolbar

    19
    0 Votes
    19 Posts
    3k Views
    M
    Thanks Anton, I was thinking, that I'm doing something wrong, but it seems that this behaviour is not changed yet.
  • Transform face to a known plane

    15
    0 Votes
    15 Posts
    2k Views
    C
    @fredo6 said: > tr_axe_inv = Geom;;Transformation.axes(face.vertices[0].position, *(face.normal.axes)).inverse > Neat! Just saved fifteen lines of code in a script...
  • Webdialog losing focus in V16?

    7
    0 Votes
    7 Posts
    896 Views
    K
    I think I have a fix for the textbox input losing focus. Just a few lines in the html/Javascript. In the body: <body onblur= go_focus();> And in the Javascript part: function go_focus(){ document.getElementById("textbox").focus(); } Doing a self.focus() or window.focus() doesn't seem to work. Edit: applying the same code to some more complex plugins doesn't seem to work...
  • Module-class

    7
    0 Votes
    7 Posts
    768 Views
    M
    Mario, This might help (I reformatted your code a bit), see the last couple of lines -- # require 'sketchup.rb'   # why?  not needed for this code module McF3D   class McF3DTools      def initialize       @mod = Sketchup.active_model  # Open model       @ent = @mod.entities          # All entities in model       @sel = @mod.selection         # Current selection     end     def perceOuv       unless @sel[0].is_a?(Sketchup;;ComponentInstance) &&           @sel[0].definition.behavior.cuts_opening?         UI.messagebox "Sélectionnez un composant F3D !"       end       end    end # class McF3DTools end # module McF3D obj = McF3D;;McF3DTools.new() obj.perceOuv()   The topic of modules & classes in programming is very complex. Conversely, what most people writing a SketchUp extension need to do is a very small subset of that topic. HTH, Greg SUMD SketchUp Misc Docs
  • Enable Web Inspector in WebDialog on Mac

    9
    0 Votes
    9 Posts
    2k Views
    TommyKT
    @driven said: Tommy, just set it as a global preference and it works for SU and Safari... defaults write NSGlobalDomain WebKitDeveloperExtras -bool true paste into Terminal or wrap in %x() from Ruby Console... john YES! IT WORKS! SO SIMPLE! THANK YOU!
  • SQLite in SketchUp Ruby

    17
    0 Votes
    17 Posts
    4k Views
    D
    you can set the format for the output, so for a webDialog you can use... html = %x(/usr/bin/sqlite3 -html /private/tmp/sp500-data.sqlite "SELECT * FROM companies;") or there's -csv -list -line -column...
  • Creating a Solid with a set of points

    6
    0 Votes
    6 Posts
    675 Views
    medeekM
    Wow, I need to come here more often. I'm going to look into the "intersect_with" method further and see if this might not be the key to overcoming this hurdle.
  • Profile Builder API?

    6
    0 Votes
    6 Posts
    1k Views
    TommyKT
    Whaat, It would be amazing to have an API. Could you also perhaps include a callback system when a profile member or assembly is created/edited, so that other plugins could do their magic? On the information side of things, it could be things like updating a "price" attribute, which is based on the volume of the profile output, for instance. For such a callback, the useful variables would be: the geometry representing the path of a PM the group for the outputted member the face of the profile / components that make up the assembly.

Advertisement