ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Absurd camera behaviour

    9
    0 Votes
    9 Posts
    179 Views
    Dan RathbunD
    Ok I played around a bit in the console.. and I agree with you. This is another example of poorly wrapped C++ objects that can cause Rubyist's nightmare. Each time we call Sketchup.active_model.active_view.camera we get a new Ruby object. Ex: Sketchup.active_model.active_view.camera == Sketchup.active_model.active_view.camera %(#008000)[>> false]
  • Rendering_options pause start_timer?

    4
    0 Votes
    4 Posts
    190 Views
    A
    Thanks for the replies and for the correction about @id. I changed both, but it doesn't solve the problem. It seems the timer starts correctly and counts until the end, only the action (code block) isn't executed until the user hovers empty space or give focus to other UI elements. @unknownuser said: I wouldn't set @model.rendering_options['ForegroundColor'] in the draw event. I agree (I didn't think about that), although I didn't notice it in Edit → Undo... I now chose to get along without text color.
  • Extend view.write_image?

    4
    0 Votes
    4 Posts
    147 Views
    Dan RathbunD
    @unknownuser said: (referring to Windows ALT+PrintScreen manual workaround.) ..., but I needed some to write a code to save and image from my plugin. You may on Windows only, use Win32OLE.so and the SendKeys() function.
  • Scale model converter.

    2
    0 Votes
    2 Posts
    309 Views
    TIGT
    You haven't really explained why you are doing this. Is it something like you model an aircraft full size and then want to have a dimensioned 1/12 scale model? If so then do this... Make sure you are in the model entities context [i.e. not editing a group etc] Draw a line 12" long [assuming you are using inches]. Use the Tapemeasure tool and click the two ends of the line. The VCB should show 12". Immediately type 1" + <enter>. You are asked if you want to scale the model. Answer 'Yes'. The line and the rest of the model are now 1/12 the size they were... Erase the unneeded line. To make other scalings from a full sized version simply draw the line an appropriate length, so for 1/48 use a 48" line scaling down to 1"... A tool listing all the possible scales will take as long to use as this simple method and of course it's probably not have the scale you wanted in the list anyway! To reverse the scaling... let's assume 1/12... draw a line 1" long, Tapemeasure pick its end and type 12" etc, and everything is scaled back to full-size again...
  • Should we cache the API docs?

    8
    0 Votes
    8 Posts
    156 Views
    thomthomT
    @unknownuser said: Hey guys, I really don't expect anything weird to happen with the docs. Google is obligated (and happy) to host our current web resources until such time as we have a replacement ready. (One with rejuvenated user comments. ) Good to hear! (Great new logo in your profile! )
  • File.dirname(__FILE__) returns nil?

    5
    0 Votes
    5 Posts
    883 Views
    W
    Weird, now the user says the problem is not occurring anymore without any explanation. Lovely! Sorry for wasting your time Dan,TiG. Thanks for the help!
  • Context Menu Question

    3
    0 Votes
    3 Posts
    97 Views
    K
    Thanks Dan that worked and was just what I needed. Keith
  • Looking for a report

    5
    0 Votes
    5 Posts
    167 Views
    genma saotomeG
    @dan rathbun said: Seems like you are trying to do things the hard way. Nope. I'm doing things "The Game Way". EXPORT the fewest polys, fewest textures, no textures on backfaces, no polys w/o textures. As minimal as possible... applying a texture to a component puts that texture on the backface -- I can't allow that. The code I showed, above, was what I use to identify and color untextured polys bright red (written by someone else). If they're big enough, I'll see them and either delete the poly or texture it correctly. 99 out of 100 times, I delete the poly. I need either a report OR a modification of the code I posted, whichever will get me a display/listing of all component/texture assignments. With the information in hand I can go right to the specific component definition and find the problem. W/O it's an ordeal.
  • Newbie question - execute jar file in ruby

    16
    0 Votes
    16 Posts
    3k Views
    Dan RathbunD
    Hmmm... OK. Yes, actually it's Ruby 1.8.x itself that uses "green threads" instead of native threads. You might have more luck using a OLE interface to the java. See: [Plugin Library] Win32API and Win32OLE so files and: WIN32OLE rdoc
  • Load_from_url

    22
    0 Votes
    22 Posts
    678 Views
    Dan RathbunD
    @tig said: There are new API methods with the latest v8M2 to extract files/subfolders [into Plugins] from zip/rbz files. However, if you already have ways of extracting them, then the moving to their new locations can be done with vanilla Ruby Dir and File commands... Or the extended library FileUtils FYI.. there is a Pure Ruby (beta) edition of the Zlib library that is cross-platfrom (no need to deal with compiled so/dll, Ruby version, compiler versions, etc. etc.) It is by Park Heesob (who is involved with Daniel Berger's win32-api project.)
  • 3d points of coplanar polygons - SketchUp Ruby API

    6
    0 Votes
    6 Posts
    866 Views
    V
    @sdmitch said: vhiguita, Are you still working on this problem or do you have a solution? I was interested in your problem and thought I would give it a try. Using the data from you post, I created a "html" file and created a plugin to read it and place the data. My html file contains the faces, lines and points but the lines and points are really the only data you need. I assummed the units were feet. It would help if I had an actual file to work with so post one if possible. Hi, I found the solution, there are many ways to get this, for example with PHP you could load all the html to a string, you could apply regular expressions to get the values (<div>,<span>, etc) from the tags review curl library.
  • Writing custom aditional data in .skp

    5
    0 Votes
    5 Posts
    173 Views
    AdamBA
    Just keep in mind that if you start attaching data to every Entity, you'll have massive file bloat.
  • Ruby Module Variables

    10
    0 Votes
    10 Posts
    2k Views
    A
    @dan rathbun said: All of your modules and/or classes need to be within your "author" namespace. If you need one copy of some code, make it a module. If you need multiple copies of some code, make it a class, and use multiple instances of the code. Ok, good advice, thaks . Now I'm on my way to 'Keep on typing' the code.
  • Need some help with write_image

    7
    0 Votes
    7 Posts
    356 Views
    jeff hammondJ
    @tig said: I think you'll need to at least make a temporary file and use some as/terminal/shell stuff ... osascript -e "tell app \"Finder\" to set the clipboard to (POSIX file \"~Documents/mytemp.png\")" perhaps i think something like that could work.. i found a way to do it with straight applescript (still using a temp file location) which eliminates using Finder.. set the clipboard to (read ("path/to/the/image.png") as «class PNGf»)
  • View.draw_text invisible?

    6
    0 Votes
    6 Posts
    525 Views
    thomthomT
    @aerilius said: (I hope the API comments will be back at the site at some time.) Yea - I'd made notes about the draw_points bug in the old comments...
  • BoundindBox intersect problem

    12
    0 Votes
    12 Posts
    226 Views
    Didier BurD
    Hi guys, Thanks for all these comments. What I'have done finally is the following: Made a hash with all my buildings and their local bounding boxes, Iterated through this hash and test all other bounding box points of other buildings, skiped all bounding boxes that are way too far to intersect with the considered building, coded a method to test if a 3dPoint is in a set of 8 points (a bounding box). This is a very fast and efficient process (about 200 buildings collisions (with all 199 others) tested in 0.5 second) Regards,
  • Md5 encoding in sketchup

    8
    0 Votes
    8 Posts
    1k Views
    Dan RathbunD
    These files do not belong in the "Plugins" dir. The should stay in the Ruby "lib" & platform dirs, and you should add those paths onto the $LOAD_PATH array. These so files also need "digest.rb" and "digest/sha2.so" (at least in Ruby 1.8.6-p287,.. where "md5.rb" is no longer needed.)
  • Open Component Options window with Ruby?

    6
    0 Votes
    6 Posts
    467 Views
    D
    Excellent! That did the trick Dan, thank you!
  • 'Dynamic' array

    13
    0 Votes
    13 Posts
    305 Views
    J
    Works like a charm now Thanks !
  • HTML 5?

    3
    0 Votes
    3 Posts
    154 Views
    A
    @gaieus said: especially that IE 9 is only for Vista and above Exactly that is a problem. Now we are happy that IE6 is almost extinct and Microsoft's newest browser is nearly standards-compliant, but now Microsoft seems to abuse IE9 to get rid of Windows XP (and that can take long, meaning we still have to support IE8's peculiarities). Another problem is that Flash has generally been very cross-platform and cross-hardware and Flash or Java work also ok for 3D graphics (some might disagree). On the other side HTML5 WebGL has been designed not to work on older hardware.

Advertisement