💡 LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering Download Trial
  • Component Axes

    3
    0 Votes
    3 Posts
    8k Views
    H

    Boom! That worked!
    Thank you sir!

    --J

  • Using Shoes (ruby UI) in sketchup plugin

    2
    0 Votes
    2 Posts
    7k Views
    Dan RathbunD

    @sminky said:

    Hi,
    Is there any way to use Shoes to make UI for a sketchup plugin?

    No. sorry. A special fork and compilation of the Shoes code would be required, afaik.
    I believe that no one has attempted it.

  • How do I check if component name starts with a certain word?

    4
    0 Votes
    4 Posts
    8k Views
    Dan RathbunD

    .

    Ruby 2.x+ (SketchUp 2014+)

    [String#start_with?](https://ruby-doc.org/core-2.0.0/String.html#method-i-start_with-3F)

    ie ...

    if e.definition.name.start_with?("MyComp")

    ... or ...

    if e.definition.name.start_with?("Door","Window")
  • Component definition has TWO names ???

    5
    0 Votes
    5 Posts
    7k Views
    Dan RathbunD

    @didier bur said:

    Sketchup.active_model.name is NOT (always) the same as the SKP file name...

    Sketchup.active_model.name

    and

    Sketchup.active_model.description

    are used to set the name and description when you will be using the entire file as a component.

    Secondly, these 2 fields are used to set the name and description that will be displayed when using the file as a template.

    So it seems that someone who saved the file, renamed it using francais and resaved it under the old english filename.

    There are cases when the filename (minus extension) are used to set the component name. Importing an image is one case.

  • Problems with ShadowTime/Time conversion

    7
    0 Votes
    7 Posts
    10k Views
    T

    Hi Careca,

    Thanks for the extension - looked great - but I'm having trouble with getting it off "summer" in the drop down so it will work with "winter" instead and with a bit different times. Also, how do we output the nice shaded shadows combination, let's say from 9AM thru 4PM on Dec 21, 2019 for our customer? Maybe I've installed it incorrectly? No instructions have shown up either. I'm on a Windows 10 with SU 18.
    Thanks !

    tab1

  • How to use animation (nextFrame) when key pressed?

    3
    0 Votes
    3 Posts
    8k Views
    PixeroP

    Thanks. Ill try that.

  • How to reload a extension loader file?

    5
    0 Votes
    5 Posts
    10k Views
    rami_lpmR

    I use this.

    def self.reload() Sketchup.send_action(CMD_RUBY_CONSOLE) load __FILE__ puts "reloaded #{__FILE__.to_s}\n" end
  • Order in Extensions menu

    3
    0 Votes
    3 Posts
    6k Views
    PixeroP

    Thanks for clarifying it.
    I had a hard time finding my own plugin in the menu and thought something was wrong with the code. 🤣

  • Import script to import 300 dae into 1 project

    27
    0 Votes
    27 Posts
    20k Views
    S

    Hi mate, maybe operator error the first couple of times I tried. Confirmed working in SU2019 Pro both with Collada DAE meshes created in Meshlab and from batch triangulated Collada export from Blender.

  • The component information inside the group extract

    6
    0 Votes
    6 Posts
    8k Views
    T

    Thank you for your help.
    It works perfectly.
    Thank you again.

  • Collecting groups and components with certain material

    6
    0 Votes
    6 Posts
    7k Views
    TIGT

    'Containers' are groups or component-definitions, which 'contain' entities - they are usually referred to as 'entities-collections' - but 'containers' is synonymous...

  • Help with dialog

    6
    0 Votes
    6 Posts
    7k Views
    PixeroP

    Thanks. That worked.

  • "Cannot convert argument to Geom::Vector3d" error

    2
    0 Votes
    2 Posts
    7k Views
    TIGT

    Before the line starting angle...
    Add in these to see what the arguments you pass are

    out the possible obj_axis permutations and retest...

    ` p e
    p tr

    p a_vector
    p obj_axis

    p a_vector.to_a
    p obj_axis.to_a`

    If one or both of them are NOT vectors, then we've got somewhere...

  • Selected entity question

    8
    0 Votes
    8 Posts
    7k Views
    PixeroP

    They are just for two small snippets that I will need some advise from Thomasz (Thea settings) to make them properly.
    I'm just preparing for when he will have some time to look into it...

  • HTMLDialog - Change source on the fly? Possible?

    2
    0 Votes
    2 Posts
    6k Views
    placidfuryP

    Did more searching, and found one spot that said the source couldn't be changed (at least not in the way I was meaning). I guess to do what I really want to do, I'd have to dive deep into this, and I just don't have the time since my development work is a "side" project at work.
    I DO however have time to use TT's SKUI, so that's what I'm going with, since I have already used it for a couple dialogs already in this project.

  • Ruby Component Insertion and Attributes - Not Updating

    7
    0 Votes
    7 Posts
    8k Views
    placidfuryP

    Just now saw this - I have been unable to get a batch redraw of DC's to not take significant time. It seems the more DC's you redraw in the same operation, the longer each successive one takes to redraw.
    Eventually, I found a way around this by simply scrapping my usage of DC's and switching to groups. Operations on groups are essentially instantaneous.
    I'd use DC's if it's one or few objects at a time, or something I want the user to be able to interact with via the DC interface, but most of my plugin's objects are not that - I'm manipulating them with my code. Since I'm doing Engineered Wood Products layouts on very large multifamily buildings, I end up with thousands of objects to manipulate, and DC's simply didn't work well enough, as they were too slow. And the fact that even changing one property - even one that doesn't affect geometry - forces you to have to redraw them each, that time involved was a deal-breaker.

  • Modify highest face

    2
    0 Votes
    2 Posts
    7k Views
    V

    Ok I find the way, it works with local_bounds

    model = Sketchup.active_model sel = model.selection bbox = Geom::BoundingBox.new sel.each {|grp| bbox=grp.local_bounds get_entities(grp).find_all{|e| is_kind(e,"Face") }.each{|fc2| pl2 = fc2.plane if fc2.normal.parallel?( vec3d(0,0,1) ) and ( bbox.max.on_plane?(pl2)) fc2.layer = "K-Masque" edges = fc2.edges edges.each {|edg| edg.layer = "K-Masque"} end } }
  • Two different colors to the same shape

    2
    0 Votes
    2 Posts
    13k Views
    TIGT

    Please use 'code' blocks to format long Ruby extracts.
    I've fixed your post for you this time...

    You need to find all 'vertical' faces in the group named 'Top'.
    After the last part of the code add this...

    vfaces = entities.grep(Sketchup;;Face).find_all{|f| f.normal.z == 0 } vfaces.each{|f| f.material = clr }
  • Messagebox within a callback fails

    5
    0 Votes
    5 Posts
    6k Views
    Didier BurD

    @TIG
    Thanks for the hint, unfortunately it doesn't help, I'm getting the correct values for face and dist outputs. BUT, I tried to call message box in others callbacks, it worked in every case.
    So what was wrong with this particular callback ? Guess what, one CANNOT call a UI.messagebox after a webdialog (or html dialog) closes, modal or non-modal.
    There's some kind of logic here...

    This doesn't work:

    # callback cancel @web_dialog.add_action_callback("dlg_cancel_settings") { |d, p| @web_dialog.close() r=UI.messagebox("Are you sure ?",MB_YESNO) }

    This works:

    # callback cancel @web_dialog.add_action_callback("dlg_cancel_settings") { |d, p| r=UI.messagebox("Are you sure ?",MB_YESNO) @web_dialog.close() }
  • [Plugin] Slender - Baking textures in Sketchup with Blender

    29
    0 Votes
    29 Posts
    14k Views
    N

    I should have also included I am using win 10, blender 2.79c, sketchup 17

Advertisement