sketchucation logo sketchucation
    • Login
    1. Home
    2. RunnerPack
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 32
    • Groups 1

    RunnerPack

    @RunnerPack

    10
    Reputation
    1
    Profile views
    32
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    RunnerPack Unfollow Follow
    registered-users

    Latest posts made by RunnerPack

    • RE: "AAHHH!! my brother is an evil genius!"

      Great idea and superb execution! ๐Ÿ‘ I agree wholeheartedly with every positive comment posted above (to save me some time repeating them ๐Ÿ’š).

      There's only one thing that I would add: the hydraulic cylinders need hoses! I forgive you for not adding them, since I know how hard it is to model nice hoses/wires/etc., but if you want to take the realism ("epicness"? ๐Ÿ˜†) to the next level, that's my suggestion.

      Thanks for sharing!

      posted in Gallery
      RunnerPackR
      RunnerPack
    • RE: UI.messagebox "beep"

      @thomthom said:

      Use the bitwise And operator to combine flags:
      Messagebox with Yes/No button and question mark icon:
      UI.messagebox('Hello World', MB_YESNO | 32)

      That's actually the Or operator... but you knew that ๐Ÿ˜‰

      Sorry... pedantic mode, off! ๐Ÿ˜„

      @Dan: I've also always wondered what all the obviously-Win32-API-based things did on the Mac version... I always assumed they just translated stuff to the appropriate Mac system-calls/constants, but it would be nice to know for sure.

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: [Plugin] Camera Stats

      Thanks, Martin. Another in a long line of very handy plugins! ๐Ÿ˜„

      Just a couple of bugs to report, and one feature request:

      First, I'm running XP SP3, SU 7.1.6860 (free version), and my IE is version 8.0.6001.18702. It seems to have problems when I use it, (which is rarely ๐Ÿ˜› ) so it could be IE's fault, not yours... Anyway, I get the JavaScript error dialog shown in the attached image when I start the plugin (that is, when I open the window, not when SU starts).

      Also, the "close" button on the Camera Stats window doesn't do anything (possibly related to the JavaScript error?).

      Finally, the feature request:

      It would be very handy if I could "pan" the camera left and right, relative to the viewport, by a specified value. For example, if I panned it right by about 2.5", it would be like I closed my left eye and opened my right (do you see where I'm going with this? ๐Ÿ˜‰ ). I know (for me, anyway) the math would be pretty rough, but if you have the time, (you obviously have the grey-matter ๐Ÿ˜‰ ) I would use this feature ALL OF THE TIME! ๐Ÿ˜„

      Anyway, thanks again for the cool plugin!

      EDIT: I just had another look at the Camera object API, and I think I know how to do this... Take the cross product of Camera#up and Camera#direction, use the resulting vector (or its negative) to transform Camera#target and Camera#eye, and use Camera#set to put it all back together. Am I close?

      EDIT 2: โ˜€ Success! After just a bit of tinkering, I got it working! ๐Ÿ˜ฎ ๐Ÿ˜ฒ ๐Ÿ˜„

      It's pretty much as I said above, but I had to experiment to find out how the API wants things done (plus I was a bit rusty at Ruby ๐Ÿ˜ณ)

      I'm going to clean this up and make a new thread for it, just in case someone can use it, but here it is if you, Martin, want to incorporate it (not that you need my amateurish code ๐Ÿ˜‰ ) or if someone wants to see what I'm blathering about ๐Ÿ˜‰.


      IE JavaScript error dialog


      Stereo Panning Plugin (WIP)

      posted in Plugins
      RunnerPackR
      RunnerPack
    • RE: Removing 2D entities from skp using script

      I think the defacto standard in this forum is that the original poster (e.g. you) edits his/her first post and adds [Solved] to the beginning of the title, to let people know there is a solution in the thread.

      I could be wrong, though, since I'm also quite new here...

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: Removing 2D entities from skp using script

      @venommax said:

      [...] I need this to do a batch update on a set of sketchup images. [...]

      @tig said:

      [...]
      Tip: please stop referring to them as "SketchUp Images" as that would be something quite different, and NOT we are dealing with here !
      โ˜€

      I think he meant "SketchUp Documents" meaning multiple model files. โ˜€ ๐Ÿ‘Š

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: Removing 2D entities from skp using script

      A two step method would catch 99% of cases:

      Step one: just check the bounding box. If it's 2-D, so is its contents. If not, it could still be a flat object rotated relative to the container's axes. So...

      Step two: Loop through the faces in a group/definition and check their normals. If they're all parallel, it's "flat".

      What these wouldn't catch would be something like a deck of 2-D cards, with individual faces - all parallel - on different planes. You could add a third step to check for non-coplanar faces, but the first two would probably be sufficient for what I think venommax's needs are.

      If nobody codes it in a week, I can do it (deadline...).

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: In over my head?

      It looks pretty good, Mike. I do see a couple of problems, though (most of which are quickly found by having the Ruby console open when you try to run it ๐Ÿ˜‰ it's really easy to use with Jim's Ruby Toolbar: http://forums.sketchucation.com/viewtopic.php?f=180&t=1542 ๐Ÿ˜ž

      1. A typo: "rasie" instead of raise.

      2. In that same if block, you should probably abort the rest of the script if there are no point sets... Just put in a "return" with an optional value.

      3. On the same topic, you may want to replace all the message boxes with "puts" statements and use the console. I find it much less annoying than all the clicking ๐Ÿ˜‰

      4. In both "each_with_index" statements, you reuse the name of a local variable for an iterator. This is probably okay, I just like to nit-pick ๐Ÿ˜‰.

      5. Finally, if you ever want to debug by reloading just the script (rather than SU itself), you'll start filling up your "Plugins" menu with "Plot Data File" items. Better to define this in its own method (preferably in its own Module) and point to it with a menu inside a block, like so:

      
      require 'sketchup'
      
      module YourModule
      	def self.plot_points
      	.
      	.
      	.
      	end
      end # Module
      
      unless file_loaded? ( File;;basename( __FILE__ ) )
      	UI.menu('Plugins').add_item('Plot Data File') { YourModule.plot_points }
      	file_loaded File;;basename( __FILE__ )
      end
      
      

      One last thing: Can I have a ride in your plane when you get the wings sorted out? ๐Ÿ˜‰

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: How to read the windows registry?

      Why not just use a plain-text configuration file located in your plug-in's ".../Plugins/pluginname" folder. You could use INI, XML, JSON, RON, etc.

      This would have the advantages of working on both Vista and OSX transparently, and it would probably be more powerful and easier to implement, to boot.

      As a long-time Windows user, I think the registry was a terrible idea that was also quite poorly implemented. I understand that it was designed to make the job of administrators of large corporate networks easier, but as an individual computer user, I tend to prefer programs (and plug-ins ๐Ÿ˜‰ ) that use a human-readable ini file of some kind.

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: Similar Group Finder - Script beginning needs testing

      This is a very cool idea for a plug-in! I've thought of it myself, of course (most people who've worked with SU for very long probably have) but then thought of how hard it would be to write (and how slow it would probably run on my ancient PC ๐Ÿ˜‰ ).

      But, I'm very glad to see the gauntlet has been taken up - especially by someone as talented at plug-in writing as Chris F. ๐Ÿ˜„

      I have been studying the transformations of Groups and the geometry inside for a plug-in I'm making, so I may have something to add to this in later stages (though I'm terrible at math).

      Thom:

      Not to criticize your coding style or Ruby skills (or those of "jeff99"), but I thought I'd point out that, in Ruby, both the "return" statement and the trinary conditional are technically superfluous, in this case.

      Since the condition itself evaluates to either 'true' or 'false', and since Ruby returns the value of the last statement as the method's value, the entire contents of the method could be simply:

      # Compare two floats with some tolerance. (Thanks jeff99 and thomthom)
      def self.floats_equal?(float1, float2, epsilon = 0.00000001)
        ((float1 - float2).abs < epsilon)
      end
      

      (One could also make it easier to use by overriding the === [triple equals] method for floats, but I don't know what the consequences of this would be. Maybe a '====' method, instead?)

      I don't know what impact, if any, this would have on the speed of a plug-in, but one like Chris' would be doing a lot of these...

      Also, is that a loose enough tolerance for this usage? I suppose it would depend on the scale and level-of-detail of each model.

      Well, I'll stop wasting everyone's time now ๐Ÿ˜†

      posted in Developers' Forum
      RunnerPackR
      RunnerPack
    • RE: How do we view methods, (And their Arguments) of a Class

      You can't show the arguments, but calling the '.methods' method on a class will list its methods and '.instance_methods' will give the same for an instance of it (i.e. an object); or you can just call ".methods" on an actual instance. To make it easier to understand, I usually to do something like:

      puts (MysteryClass.methods - Object.methods).sort
      

      Which lets you ignore the built-in methods inherited from the default parent class (including ".methods" itself ๐Ÿ˜„ ) and displays the result alphabetically.

      By "a compiled class that is 'Required'" I assume you mean a 3rd party (binary) extension. Is that right? If so, some info can be gleaned from the binary itself, but not much (if any) more than using ".methods" and the like.

      You can look at it in a hex editor and usually see the names of classes, methods, etc. Under windows, I prefer this for snooping around ๐Ÿ˜‰

      Well, I doubt if that helps, but there it is...

      posted in Developers' Forum
      RunnerPackR
      RunnerPack