Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

Subcategories

  • No decscription available

    20 Topics
    462 Posts
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Win 7 to Win 8 => no system() anymore...

    10
    0 Votes
    10 Posts
    465 Views
    Dan RathbunD
    @pixero said: @thomthom said: ... I then add a .rb file in the Plugins folder that adds that folder to the $LOAD_PATH array and then loops over all the rb and rbs files to load them. That way I'm working on my plugins in a location where I have full permissions. Could you please post how that file looks in its entirety? I would like to get that to work for me as well. @Pixero, and anyone else.. I have already posted such a script, ready-made for you to modify with your custom paths, be it a dropbox or just folders in your "user/documents" path (which you will always have full permissions to.) In addition, it adds an autoload feature that looks for sub-directories named " %(#408000)[!_autoload]", in ALL of the $LOAD_PATH directories, and if found, will call require on any loadable files it finds. I do this because this way you KNOW what files (in those custom paths,) will be automatically loading. Here's the link: [Code] !autoload.rb loads "!_autoload" folders
  • Webdialog visible/open?

    10
    0 Votes
    10 Posts
    553 Views
    Dan RathbunD
    @hgroeneveld said: What is passed to " def initialize(show_dialog)"??? The initialize() method is an "internal" Ruby method that all Ruby class objects have. IF you do not override it, the class just inherits a copy from it's superclass. This initialize() method is called automatically by Ruby at the end of the new() class constructor method, after new() has created the instance. Realize that initialize() is an instance method, and new() is a class method, therefor new() calls the initialize() instance method, in the instance object, that it just created, passing along the entire argument list it itself received. So when you do: @dlg = ShowDialog.new("Plugin Options") The new() method (internally,) will create the new instance of the ShowDialog class, (referenced internally as obj,) and THEN call the new instance's initialize() instance method, passing it the string argument "Plugin Options", like: obj.initialize("Plugin Options") Lastly, the new() method returns it's internal local reference to obj, which you then assign to a reference in the outer scope. In the example above, that reference is the @dlg variable. @hgroeneveld said: I put a msgbox there, but it never gets triggered... UI.messagebox() is a Ruby method, that when evaluated (after the messagebox closes,) returns nil, so in effect you would be passing nil into the initialize() method. So.. whatever arguments that you want to pass into the new instance, at creation time, are passed via the class constructor method new(), and YOU must override the instance method initialize() in order to process those arguments, whatever they may be. (Usually by assigning them to instance variables that the instance will later use.) This is all in Ruby, Part I, Chapter 2, Classes, Objects, and Variables
  • Loading PNG Textures in Ruby plugin and SketchUp freezes

    9
    0 Votes
    9 Posts
    587 Views
    J
    I've had problems when exporting PNG files from Corel Photo-Paint & importing them into SKUP. I found that I had to re-save the image files in IrfanView before they would play ball.
  • Html multiline, js to SketchUp

    16
    0 Votes
    16 Posts
    2k Views
    Dan RathbunD
    @myhand said: @dan rathbun said: (1) I said inside your module (not your directory!) ... Sorry Dan, I am being really thick here . Are you saying I should cut and paste the code in common.rb into MyPlugin.rb file...? It is what I told Chris to do (in case he didn't wish to have users of his code do a full Ruby install.) %(#8000FF)[An aside rant to any reader who won't read a book, and learn the basics, before diving in and attempting to write complex projects:] If you don't know what I meant by "inside your module" you likely did not follow the advice in my Newbie Guide, and have skipped over learning the nitty-gritty basics of Ruby. Yes it can be boring, but your just running into frustrations because you don't know the simple things. Really .. print out a chapter a day from the ol' "Pick-Axe" book, and put it next to toilet. Don't waste the time when your sitting on the pot. In a nutshell... you need to be writing all your code within YOUR unique top-level namespace (which is a module in Ruby.) Unwrapped code runs within the TOPLEVEL_BINDING, which is the global instance of Object ... and everything is a descendant of Object, so everything inherits whatever is defined in Object. Other authors do not want your objects, variables etc, propagating into their plugins. OK ... back on subject, ... "uri/common.rb" ... for now just leave it in the Ruby lib directory, where it belongs, and use a script similar to the one posted to push paths for a full Ruby install. See: Ruby LOAD PATHs script (Win32)
  • Using object ids to restore object instance references?

    8
    0 Votes
    8 Posts
    2k Views
    thomthomT
    Yea. Remember that the Ruby API was added in version 4 - it's on top of the C++ core in SketchUp.
  • JSON in Ruby

    48
    0 Votes
    48 Posts
    9k Views
    Dan RathbunD
    [quote="Myhand":31wco2xd]I see that %(#8000BF)[escape()] and %(#8000BF)[unescape()] are deprecated (in Javascript,) though, and that you are recommending to use [them] ***%(#BF4000)[ @unknownuser said: ]*** @unknownuser said: ](http://msdn.microsoft.com/en-us/library/dz4x90hk(v)":31wco2xd]The unescape function should not be used to decode Uniform Resource Identifiers (URI). Use decodeURI and decodeURIComponent functions instead. %(#8000BF)[decodeURI()] %(#8000BF)[decodeURIComponent()] Which do you recommend or should I continue with %(#8000BF)[unescape()]? The old functions are ASCII, the new ones are Unicode. Taking a look at the most recent released ECMA-262 (but not the latest proposed revision,) the old functions are no longer listed. see: ECMA-262, 5.1, Global Object: 15.1.3 URI Handling Function Properties ECMAScript Language Specification Standard ECMA-262 5.1 Edition / June 2011 Link to the downloadable PDF of the specification. But you need to handle the situation where an older browser does not have these functions so, write a wrapper in JS: var unesc = function(uri) { var test = false; if (typeof(decodeURI) == "function") test = true; return test ? decodeURI(uri) ; unescape(uri); }
  • Genetic algorithm bin packing

    7
    0 Votes
    7 Posts
    2k Views
    thomthomT
    Once you get your head wrapped around programming and you start to develop your plugin I recommend you read through this guide on how to ensure your plugin doesn't clash with other plugins: http://www.thomthom.net/thoughts/2012/01/golden-rules-of-sketchup-plugin-development/ There's also many more articles on my blog detailing various topics.
  • Curious dialog box

    17
    0 Votes
    17 Posts
    904 Views
    Chris FullmerC
    Yeah it was back before version 4 I think. It recorded the mouse position on the screen and mouse clicks. So if you re-positioned your SU window, the whole macro broke!
  • My plugin work on Windows not on Mac

    18
    0 Votes
    18 Posts
    741 Views
    D
    if I change the rubies encoding to uft8 and I zapp the gremlins I get this which shows the css for font size is not good. use ems [image: DcYM_2012-11-3008.31.12pm.png]
  • Workaround for "selectSelectionTool" Mac bug?

    6
    0 Votes
    6 Posts
    330 Views
    bradB
    Howdy from Boulder, I do not see a bug in our database for this issue. I'll log a bug for you guys. Take care.
  • Webdialogs: Debugging Javascript on Mac

    4
    0 Votes
    4 Posts
    248 Views
    thomthomT
    The forum search isn't that good. I have more luck using Google to search it.
  • Does someone feel fit to adjust CGAL for usage out of ruby?

    13
    0 Votes
    13 Posts
    1k Views
    N
    I've been toying around on AWS today and I realised something. One of the RGAL's dependencies is Qt3. The precompiled CGAL library in the Ubuntu repository is NOT compiled with Qt3. This means that you have to compile CGAL yourself which is always a hassle. I don't know about other platforms though. It's possible that mac's precompiled CGAL works a charm If bootstrap fails at rb_Nef_polyhedron_3.cpp because it can't find qapplication.h, you have two options. *Either comment out the show method in the cpp file (dont forget to comment out the rice refference to it at the bottom of the file) and the two lines (qapplication and Qt_widget) in the rb_Nef_polyhedron_3.h file *Or get your act together and compile CGAL from scratch remembering to set the Qt3 flag to true. Ideally, it would be nice to have the Nef_polyhedron return a qt_widget object that ruby can then put in its own qt application. I have the feeling that that just isn't possible though.
  • How to modify texture color with code?

    6
    0 Votes
    6 Posts
    320 Views
    A
    I think when setting a color to a textured material, the change becomes visible immediately, however the API does not differ between colorizing (checkbox in the materials browser) and color-shifting (pointer on the color wheel). Assuming you rotate the color wheel of a material A and get material B: [image: Z4QK_colorize.png] We can then read the color value of B: ` material.materialType 2 color = material.color Color(200, 147, 62, 255)then reset it to the texture image's original look: material.color = nil nilThis way we get A. material.materialType 1then trying to set it again: material.color = color Color(200, 147, 62, 255) material.materialType 2` This time it is also colorized (C) and we have no control about it.
  • Attributes in Sketchup - Probably a stupid question

    10
    0 Votes
    10 Posts
    1k Views
    thomthomT
    @fdarma said: Well, I have no idea that such an instance definition existed. On that topic, a detailed breakdown of how instances and definitions work in SketchUp: http://www.thomthom.net/thoughts/2012/02/definitions-and-instances-in-sketchup/ If you are fresh to SketchUp plugins I recommend you also check out this: http://www.thomthom.net/thoughts/2012/01/golden-rules-of-sketchup-plugin-development/
  • How to get the absolute coordinates of faces?

    7
    0 Votes
    7 Posts
    3k Views
    liquid98L
    Hi Ibswu, Check this: http://sketchucation.com/forums/viewtopic.php?f=180&t=48769 -- Liquid
  • New SketchUp Developers Tools - TestUp

    18
    0 Votes
    18 Posts
    2k Views
    S
    @driven said: I did wonder the same after cloning the new version and losing that fix, at the same time I added </body> > <script> bodyLoad() </script> and deleted it the top tag, again. I'm away for a few days but will try your version hack, does it work with gems? john The only reason it wouldn't work with gems is that SketchUp doesn't set up a library load path to anything except their own stuff. To get any other ruby code you need either to copy it into SketchUp's area or manipulate the ruby load path before you access it. Steve
  • Need openssl.so

    4
    0 Votes
    4 Posts
    447 Views
    B
    Thanks , TIG and Dan, I have decided to install Ruby, though it seem a little complex to me
  • An animation for a walk through in a model using ruby

    2
    0 Votes
    2 Posts
    160 Views
    Dan RathbunD
    @sachi said: User has to change the scene(click on the scene tab) manually to display the animation(to go to the next scene). No the user chooses from the menu: View > Animation > Play For Ruby YOU use the Animation class. Or just change the selected_page via the Pages collection.
  • Wrapping HTML in ruby, why?

    3
    0 Votes
    3 Posts
    186 Views
    jolranJ
    Aha, I see. So embedding HTML is more for convenience sake then. I remember even over half a year ago there where issues on Safari, thought they whould have been fixed by now. Kind of the answer I was hoping for though, if I understood it correctly. Thank you.
  • 500 Plugin Requests

    14
    0 Votes
    14 Posts
    2k Views
    Dan RathbunD
    @dan rathbun said: @tig said: So who is to produce the list of [REQ] posts that have been answered / unanswered ? (1) Can moderators set a topic to "Solved" against a certain post, with the new "solution feature" (green check button) ?? The answer to (1) I'd say is YES. Here's an image of one of my posts.[image: 8HVb_solved_post_in_topic_list.PNG] I personally changed the title prefix from "[Issue]" to "[Closed]", but it was Gábor that actually marked it solved. (He reminded me of the "solution feature" in doing so.)

Advertisement