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

    4
    0 Votes
    4 Posts
    1k Views
    G

    This is one of the more comprehensive collection of SSB's capabilities http://groups.google.com/group/Ruby-API/browse_thread/thread/982c56fae94d3537/fececa1a9d219f24?lnk=gst#fececa1a9d219f24. The topmost link will take you to Josef's download site.

  • Contour generation from ruby script

    2
    0 Votes
    2 Posts
    724 Views
    GaieusG

    Arun, this is the depository, please, do not discuss rubies here.
    The discussion about this script is already here:
    http://www.sketchucation.com/forums/scf/viewtopic.php?f=127&p=19449#p19449

    Didier has just updated his script.
    Did you make sure that you use the latest release? (The old cloud.rb does not work with SU6).

    I'm moving this thread now to the general ruby discussion forums but also lock it at the same time so there won't be two threads on the same topic (and Didier does not need to answer in several places to the same questions).

    I do really hope you don't mind this.
    Also, please read the announcement about the new board (and startin new topics here).

    BTW - Didier, could you register there? I want to move your scripts to the new place!
    πŸ˜„

  • How can I store binary data in an attribute

    7
    0 Votes
    7 Posts
    887 Views
    T

    Sounds like a case for a new requirement of the API to be able to handle a BLOB (binary large object). Perhaps a new flavor of an attribute. I'll forward your plea.

    Todd

  • Keyboard translation PC / Mac

    11
    0 Votes
    11 Posts
    2k Views
    fredo6F

    Thanks very much Todd.

    There are strange things on the Mac, like the fact that several keys (alphas and numpad) do nt seem to be trapped on the KeyDown, but only on the KeyUp event. This is also the case for Tab, Del and Backspace. This may be due to the VCB interference.

    I'll see what I can do.

    Thanks again

    Fredo

  • Can I tag an object with data and color the object....

    7
    0 Votes
    7 Posts
    580 Views
    R

    Yeah, that can't be done. It would violate the rules of component definitions. πŸ˜„

    Your options: either paint the instance, or make an instance unique (but then you are creating a new definition).

    Sorry I don't have better news...

  • Web Dialogs and SkIndigo - made for each other...

    13
    0 Votes
    13 Posts
    1k Views
    S

    search for flip4mac

    @unknownuser said:

    On a Mac, what Quick Time codec do I need to watch this AVI? I tried DivX and that didn't work.

    Todd

  • Cloud.rb & non-world origin

    3
    0 Votes
    3 Posts
    714 Views
    M

    Thank you Didier.

    Yes. That is it exactly.

    I have a series of XYZ points from an arbitrary "origin" 000.
    I want to overlay this on a Google Earth terrain, but the centre
    of the terrain (global origin) is not where I want to have my points origin.

    Currently, I do a translation in Excel before importing, but this seemed like an interesting way to get into SU Ruby, and save myself some double handling!

  • Support of Language translation - LibTraductor.rb

    6
    0 Votes
    6 Posts
    2k Views
    fredo6F

    It's easy anyway to replicate LangHandler with your own version you control (and anyway a GetString method that takes a default in case the string is not found).

    My observations were that it's seems that the community of Ruby 'scripters' prefer to avoid proliferation of files and deliver extensions with one or very few files.

  • 2Didier Bur: Extrude lines

    6
    0 Votes
    6 Posts
    913 Views
    F

    Didier, are you KIDDING ME?! THIS TOOL IS A MUST-HAVE for AutoCAD users... I mean I use this thing all the time!

    If by extrude lines he's talking about the "Extrude lines using 2 Points" tool... or the "Extrude Lines Up" tool... both of which I use many times every day.

  • Erase! gives an error: can't find parent

    13
    0 Votes
    13 Posts
    1k Views
    R

    Standard ruby conversion methods include (but are not limited to):
    .to_a - convert to an array
    .to_i - convert to an integer
    .to_f - convert to a float
    .to_s - convert to string

    Though standard ruby, they may not be applicable to all data types. SU adds more .to_n methods:

    .to_feet - convert a number of inches to feet
    .to_yard - convert a number of inches to yards
    .to_mile - convert a number of inches to miles
    .to_m - convert a number of inches to meters
    .to_cm - convert a number of inches to centimeters
    .to_mm - convert a number of inches to millimeters
    .to_km - convert a number of inches to kilometers

    .feet - convert a number of feet to inches
    .yard - convert a number of yards to inches
    .mile - convert a number of miles to inches
    .m - convert a number of meters to inches
    .cm - convert a number of cm to inches
    .mm - convert a number of mm to inches
    .km - convert a number of km to inches

    There are also .inch and .to_inch methods, but since SU internal units are inches, these are almost never used (but are included, I think, for consistency).

  • Select Smooth ruby

    2
    0 Votes
    2 Posts
    689 Views
    F

    workaround for selecting hidden lines:

    turn off 'view hidden geom'
    select all items you can see
    turn on 'view hidden geom'
    use invert selection ruby script
    you should now have only hidden geometry selected
    delete selected hidden lines

  • The colour of a sphere

    7
    0 Votes
    7 Posts
    974 Views
    A

    It's work! You did it! Thank you very much!
    I appreciate your assistance - it was a good lesson to me.
    I was so stupid πŸ˜„ ...

  • An idea... a construction arc

    5
    0 Votes
    5 Posts
    1k Views
    R

    Brad,

    Way to ask the question! I made the (incorrect) assumption that this was curved construction geometry (which I still think would be a great addition to SU).

  • Idea for script

    3
    0 Votes
    3 Posts
    581 Views
    D

    Jon

    I use SU to to design in 3d export dwg for creating con docs from the SU design model.
    My magic scheme depends on a dwg export to TurboCad, but may work for Acad as well but give it a shot and see how the export comes into Acad.

    Here is the basics for for your info.
    1-First I set construction lines for overall model limits.
    2-Then I mess around a bunch to find the design form in 3d that will also work for interior space planning as well.
    Save a copy to a 3d file now.
    for multi-story projects the slice ruby will work for separating levels)
    3-The trick for layout is to have single lines for perimeter and interior walls blocked first.
    4-Using the [extrude along path] ruby you can now build walls of varying widths on edges or center lines on selected line segments.
    (I set the height to only a couple of feet to keep the plan easily viewable.)
    5-OK now you will have a selection of walls that are auto-grouped and selectable as such.
    Next add dimensions and you will be able move the wall elements with the dimensions adjusting parametrically.
    [[Save a copy to a 3d file now.]]
    6-When all dimensions needed are set, select walls only not dimensions and explode.
    7-Use the [flatten] ruby which should eliminate any double lines, but check to make sure.
    The [remove unused edges] ruby will finish any cleanup needed.
    8-Create a Plan View scene in ortho mode.
    9-Export to a 3d (not 2d) dwg file.
    I use the Acad 2004 format and do make sure to deselect the faces option box.

    In Tcad the import brings in all the walls and the dimensions come in as parametric entities.
    SU does not export text as editable words,but can be formated for font and size in Tcad.

    Elevations and section cuts will work the same for dimensions when needed for the Con Docs.

    Not a complete solution, but a start and Tcad
    Standard will work and the dwg export back to Acad is very good.

    I probably have missed some strokes, but here is a get started that I hope will help

    dtr

  • Force Thumbnail to update?

    3
    0 Votes
    3 Posts
    684 Views
    daikuD

    Am Not. I thought Model.save_thumbnail was just to save a thumbnail to it's own jpg file. I'm talking about the one you see in the preview box when you do a File | Open, or if you turn on thumbnails in an explorer window.

    I think I may have found what I was looking for. There's an option under "Model Info | File" called "Redefine thumbnail on save". From what I can tell, the thumbnail only gets generated when you close the file, not when you save without closing, unless this option is turned on. I assume this is to improve performance on autosave, etc. Anyway, if I enable this option (manually), I get the behavior I want. Not sure if that option is available from within ruby. CB.

  • TIG's Xref Manager

    9
    0 Votes
    9 Posts
    1k Views
    TIGT

    @matte said:

    Thanks TIG, but I can't see where to grab it from?
    MAtte

    See earlier msg for re-upload as zip...

  • Bit per minute script

    3
    0 Votes
    3 Posts
    609 Views
    PixeroP

    I think he means beats per minute. (Like in music.)

  • Fast Vector scale

    4
    0 Votes
    4 Posts
    952 Views
    tbdT

    because the internal function length is done in C world and those 3 scalar multiplies in Ruby world (which of course is slower)

  • Getting model to fix itself

    3
    0 Votes
    3 Posts
    563 Views
    Al HartA

    Thanks Gai. I searched there and could not find what I was looking for. But it is good to know that it is there.

    I remembered what we had to do (finally).

    If, during execution of ruby, you change the model, (even just adding an attribute), then all smoothing normals are lost. They get restored when the ruby exits. But you cannot use them -- for instance when exporting faces from Ruby -- unless you let the ruby routine (and any routines which called it), exit first.

    We get around this by altering the drawing, and then executing the next function with a 0 length timer. This causes the second function to get executed after the first function completes.

    This code will not work because the normals do not get recalculated.

    def do_export Sketchup.active_model.active_entities.set_attribute("t1","t2","t3") export_data # calls another ruby to export faces and normals # normals are not recalculated properly after the model was changed... end#def def export_data #export the data end#def

    This code, which sets the attribute and then uses a time to execute "export_data", will work properly.

    def do_export Sketchup.active_model.active_entities.set_attribute("t1","t2","t3") # use time to run second routine after model cleanup UI.start_timer(0, false) {UI.stop_timer(id); export_data} end#def def export_data #export the data end#def

    I seem to remember that there is some command you can issue to get SketchUp to clean up or repair the model, but I can't remember what it is. If anyone remembers, let me know! πŸ˜„

  • Get_locale

    3
    0 Votes
    3 Posts
    720 Views
    fredo6F

    Strange things actually.
    On a PC with Windows XP in French, Sketchup v6.0.277, I get the following:
    Sketchup.get_locale --> "FR"
    Skectup.os_language --> "EN" (so two characters only).

    On another laptop, with Windows XP US International version and Sketchup v6.0.515, I get:
    Sketchup.get_locale --> "EN"
    Skectup.os_language --> "EN" (so two characters only).

    So this new behavior you report seems pretty recent.

Advertisement