πŸ’‘ LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering Download Trial
  • Units problem

    3
    0 Votes
    3 Posts
    350 Views
    TIGT

    Try something like (bmaxz+$startcoord).to_cm - SUp uses the 'inch' as its units and that's what the bmax returns - if you want it to return dims in other units try things like .to_cm ...

  • Shaping ruby

    3
    0 Votes
    3 Posts
    630 Views
    L

    Thanks Jim πŸ˜„

  • Entity.set_attribute infinite loop

    6
    0 Votes
    6 Posts
    648 Views
    M

    Hi Thanks for that solution, I've tried it and it works a treat.

    Its a bit hackish but it works so it'll do.

    Thanks again.

  • Is there any way to stop snapping?

    10
    0 Votes
    10 Posts
    924 Views
    pilouP

    Possible or not ❓

  • GDI Plus coding help

    2
    0 Votes
    2 Posts
    399 Views
    T

    GDI+ is pretty powerful. It's the foundation for a LOT (if not all) of Microsoft's 2D (and maybe 3D) engines.

    If you want me to take at look at it, I can, but no promises that I'll have the level of skill and the turnaround capability you are looking for.

    (I'm a C++ kinda guy - not C#)

    Todd

  • Combining Ruby Scripts

    7
    0 Votes
    7 Posts
    1k Views
    E

    Tig - you are a star.

    I could not figure out why one or two scripts ran in the console and others did not.
    it seems that by coincidence the 'def name' was the same as the script name for the couple that worked.

    Now I understand it from your explanation, it all makes sense.

    I have a couple of other questions, but I will put them in new topics rather than take up more of your time here (although if your posting history is anything to go by you will probably chip in there too πŸ˜‰ )

  • Hidden to Layer - Script

    4
    0 Votes
    4 Posts
    888 Views
    H

    TIG,
    Thanks for adjusting your script so quickly - after a quick test it seems to work fine.
    ...
    Idea for a possible future enhancement (V1.3) ???
    ...
    May need a dialog box with a check box / dropdown choice for users - incorporate unhide_all.rb

    Currently V1.2 of the script moves all hidden objects to Layer HIDN - and they remain as Hidden objects.
    If you run the script unhide_all.rb (Thank you Rick Wilson) - all previously Hidden objects are now visible. To hide them again, users can simply turn the Layer HIDN off - very useful.
    Gives users more control over their hidden / revealed geometry.
    ...
    You could give users the option to keep hidden objects as hidden objects or to unhide them when they run the hidden2layer script.
    ...
    Thanks once again for V 1.2 - hugely appreciated.
    Regards
    Howard Leslie

  • Can Objects Have Hyperlinks?

    10
    0 Votes
    10 Posts
    6k Views
    C

    I have been reviweing the posts on this site and wanted to ask you a few questions:

    I am trying to provide a graphical "report" to a customer in lieu of the traditional 3-ring binder. I want to provide a secure web-link or CD to my customer that will allow them to view their facility, hyperlink to floorplans, piping plans, and other non-graphical documents. I feel this would be more usefull and , hopefully, allow them to continually update the information.

    Is SketchUp the right program for this? Thanks for your time.

  • Real Failings

    5
    0 Votes
    5 Posts
    655 Views
    daleD

    Rick Thanks for the reply. I started to question my sanity, but decided to follow the hierarchy of my files back to be sure they were placed correctly. As it turns out I had an older version 5 file that I had been dumping everything into, so when I located the newer SketchUp 6 file and put it in, rebooted and bingo the Kerykythea menus are in place. The plugin menu (next to window in the main menu) I found by going into the SketchUp/ Preferences/Extensions, and clicking in the Ruby Scripts Examples checkbox.
    I hope this may help someone else in the future, otherwise all my stupidity was for nothing.
    Thanks again Rick and TIG for taking the time.

    Dale

  • Irritating Class methods modification

    3
    0 Votes
    3 Posts
    475 Views
    AdamBA

    Operator overloading in any language is a lot of rope to hang yourself with. And its always the guy who just discovered that language feature that goes postal with it.

    On a related note, I got caught badly while writing some Ruby C extension last month whereby on Win32, ruby.h quietly #defines fopen() and fclose() to be something completely different! Just insane.

    Adam

  • Ruby interpreter

    2
    0 Votes
    2 Posts
    364 Views
    T

    I haven't tried it. Why don't you and let us know.

  • Shorcutting a Double Click

    5
    0 Votes
    5 Posts
    522 Views
    CadFatherC

    due to harcoding i guess.. pity because it could be useful for those task..

    remains to check whether some mouse tweaking programs can do that, you never know

  • Error loading file

    7
    0 Votes
    7 Posts
    845 Views
    TIGT

    Although the SUp Ruby API doesn't stress it, I think it's safer to put things into () after a method:

    So UI.messagebox "A message..." becomes UI.messagebox("A message..."), you are then more likely to spot errors like missing quote closing.

    If you are using Notepad++ (I do too) then set up your Ruby format defaults to say have any strings in red - then if you miss off a closing " everything afterwards is coloured red and stands out as wrong...

  • Java Script <> Ruby array transfer

    5
    0 Votes
    5 Posts
    1k Views
    J

    I was just looking at ruby-json. I noticed there were 2 ways to use it: one c-language extension, and one called "pure". Unfortunately, the "pure" is not so pure. It requires platform specific libraries also.

  • TextTag.rb

    8
    0 Votes
    8 Posts
    2k Views
    TIGT

    @stuartb said:

    dxf export still WIP TIG?

    IMPORTING - sorted!
    I am trialling Deep Exploration at the moment. It converts dwg to skp complete with text! (something Sketchup cant do currently) so I am happy that I can now get dwg into Sketchup.

    EXPORTING - still a problem!
    Sketchup - exports skp to dwg (inc dimensions) but no text-tag!
    Deep Exploration - exports skp to dwg (inc text-tag) but no dimensions!

    I need to use text-tag because 'normal' text wont stay flat . . but I cant give copies of drawings to other consultants as dwg without losing text or dimensions.

    Oh I do wish the SU team would sort this mess out.

    The DXF Export of TextTags is still WIP. Needs a long stint of effort to read TextTags' attributes and make into MText definition and then add that to a DXF file etc...

    SketchUp DOES Export TextTags as dwg or dxf (They come in as blocks - but are shapes rather than text - so later editing is NOT possible), BUT if you have the 'filled' version (without visible edges) they don't show up in some AutoCAD view style settings.

    To help with this I have adjusted the 'Filled' setting for TextTags to Yes= filled, with NO edges; Yes+Edges= filled, WITH edges and No= Edges and NO faces... Then they do show up in the exported dwg in most 'styles' if they have edges set...

    ...For new version see... http://www.sketchucation.com/forums/scf/viewtopic.php?p=47399#p47399

  • TIG: Default all Layers

    8
    0 Votes
    8 Posts
    1k Views
    S

    I can definitely use this! Thanks so much!

  • What Font do you use?

    4
    0 Votes
    4 Posts
    503 Views
    J

    Thanks guys, Courier New looks good (size 10.) The default was Terminal (ack.)

    I also am trying out color schemes. The image I posted is a little washed-out compared to the real thing, for some reason?

    http://bp3.blogger.com/_ogonR-k5OoM/R9Wlwmq-pPI/AAAAAAAAHS0/R-KjBbVdtHk/s1600/ss.jpg

  • Right-click

    3
    0 Votes
    3 Posts
    477 Views
    R

    It could be put at the bottom of the list via ruby. Putting it at the top of the list would be a feature request best directed to the folks at Google.

  • Change Color of a model

    5
    0 Votes
    5 Posts
    615 Views
    T

    Try this:

    w = 2500.mm d = 2000.mm h = 1000.mm pts = [[0,0,h-40.mm], [w,0,h-40.mm], [w,d,h-40.mm], [0,d,h-40.mm]] group = Sketchup.active_model.entities.add_group container = group.entities ; base = container.add_face pts h = -h if base.normal.dot(Z_AXIS) < 0.0 base.pushpull 40.mm group.material = "red" ;

    Todd

  • Create your own sky and ground?

    14
    0 Votes
    14 Posts
    6k Views
    AdamBA

    I initially implemented skyboxes in pure Ruby in SU.

    # skybox functionality class MyViewObserver < Sketchup;;ViewObserver def initialize(stub) .. build a definition using 'stub' as filepath skybox = Sketchup.active_model.definitions[dname] @skybox = Sketchup.active_model.entities.add_instance skybox, Geom;;Transformation.new @skybox.locked= true end def onViewChanged (view) @skybox.locked= false @skybox.move! view.camera.eye @skybox.locked= true end def remove @skybox.locked= false Sketchup.active_model.entities.erase_entities @skybox end end def add_skybox $skybox = MyViewObserver.new("~projects/Ruby/skybox/space1") Sketchup.active_model.active_view.add_observer($skybox) end

    ie Sketchup will move the skybox along with your camera. Works OK - only let down by SU crazily aggressive bounds on Z when it draws.

    Adam

    @alan fraser said:

    Texture Maker will generate a cgi landscape and sky and export it in a variety of formats...including a skybox. Screenshot and result attached below.
    Sky boxes are used extensively in games and work very well. They can be used well in SU, as Adam says, but only really from a very fixed viewpoint....that being the centre of the cube.
    Games get around this by locking the skybox to the viewer. As you move through a first person perspective shoot-em-up the skybox moves with you, so always appears in the correct perspective and always infinitely distant. This obviously isn't the case in SU.
    I realise this thread has drifted slightly away from Ruby, but there's a challenge for somebody. πŸ˜‰
    Skyboxes can work well in SU, but generally only if you move a few feet...or catch a glimpse out of a window, not up and down streets. Of course you can make them really huge, so that any novement by the viewer is very slight in comparison...but then you get clipping problems.

    The simplest solution is simply to map a panoramic image around a cylinder. Here is a very old thread from the old forum, now transferred to Google Groups. So old, in fact, that it predates SU's ability to map around cylinders, so I had to do it by slicing the image into sections...but the resulting skps still work ok for most situations.

Advertisement