🏒 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • [Question] on transformation.rotation

    3
    0 Votes
    3 Posts
    396 Views
    R
    Great, thanks TIG! Now it works
  • How to set Layer property of a Group?

    7
    0 Votes
    7 Posts
    490 Views
    Dan RathbunD
    @grojguy said: Ah yes, OK, that would make sense, i.e. class inheretance. But, from your comment I was anticipating seeing "layer=" in the instance methods list returned by that nifty command... So, why is "layer=" it not in the list? Because.. you see the warning for the "show inherited" argument is default false for your version of Ruby, but will (actually was,) changed to true as a default, in all Ruby versions 1.8.1 and higher. IF you are still using Sketchup 7.x, then the Ruby DLL distro'd is v1.8.0-initial_release (ie: patch_level p0) You can backup the current "Deceased 1.8.0" dll, msvcrt-ruby18.dll by renaming it: msvcrt-ruby180_p0.dll then replace it with your choice of a newer version from: Ruby Interpreter DLLs (Win32) (you will need to make a copy of the version you want Sketchup to load named: msvcrt-ruby18.dll.) .
  • Undo shifts geometry

    5
    0 Votes
    5 Posts
    228 Views
    thomthomT
    No - I need to ensure that when the tool deactivated that the group is closed.
  • Outliner like tool for geometries

    3
    0 Votes
    3 Posts
    181 Views
    W
    Short version. Sketchup to G-code. The version, sketchuptogcode, does not follow the edges accurately enough. Long version. G-code is the language used to drive the automated router I have access to. I have worked out the details of the three designs in sketchup, then I reenter the design into another CAD tool that can output g-code. I'm just way too lazy to enter even my simple designs twice. G-code is an "edge" based language. G-code commands the router to move in 3-D lines and arcs. A few details beyond just following a edge, but pretty straight forward. I have written software to perform this kind of task many times in my past life, but it was not done for Sketchup in Ruby. As a retired programmer, I thought I might look into creating a g-code generator. So a Ruby script that outputs geometry info serves two functions: offers a concrete example I can build on; and offers a concrete example I can learn from. I know I will learn Sketchup and Ruby much faster if I have a problem that's of interest to me. Woodworker Bob, retired programmer - I'm so old I wrote programs using paper tape and teletypes.
  • [Code] Group.real_parent

    2
    0 Votes
    2 Posts
    1k Views
    thomthomT
    Standalone version - doesn't extent the base class and also returns the definition for Group, ComponentInstance and Image entities: # Returns the definition for a +Group+, +ComponentInstance+ or +Image+ # # @param [Sketchup;;ComponentInstance, Sketchup;;Group, Sketchup;;Image] instance # # @return [Sketchup;;ComponentDefinition] # @since 2.0.0 def self.definition(instance) if instance.is_a?(Sketchup;;ComponentInstance) # ComponentInstance return instance.definition elsif instance.is_a?(Sketchup;;Group) # Group # # (i) group.entities.parent should return the definition of a group. # But because of a SketchUp bug we must verify that group.entities.parent returns # the correct definition. If the returned definition doesn't include our group instance # then we must search through all the definitions to locate it. if instance.entities.parent.instances.include?(instance) return instance.entities.parent else Sketchup.active_model.definitions.each { |definition| return definition if definition.instances.include?(instance) } end elsif instance.is_a?(Sketchup;;Image) Sketchup.active_model.definitions.each { |definition| return definition if definition.image? && definition.instances.include?(instance) } end return nil # Error. We should never exit here. end
  • Interacting with a Sketchup file from another program

    21
    0 Votes
    21 Posts
    6k Views
    Dan RathbunD
    I think the answer is to export as Collada (.DAE,) and have the website use the Google O3D plugin. (Manipulation and User Interaction is done via Javascripting.)
  • Snap Alignment

    13
    0 Votes
    13 Posts
    3k Views
    R
    My ideas was do create a Fence-Builder where you can plan fences for your garden. So you could be able to snap the fences vertically and horizontally. Add doors and so on. Thats what snap alignment would be great for.
  • Create zip files with sketchup ruby api

    4
    0 Votes
    4 Posts
    879 Views
    TIGT
    That's one but there's also http://rubyzip.sourceforge.net/
  • Get Mouse x,y on "resume"

    2
    0 Votes
    2 Posts
    235 Views
    thomthomT
    Don't think you can. It's one of the several annoying limitations of the Tool class. (Why doesn't activate return an view argument?)
  • Using printf to help trace ruby errors

    2
    0 Votes
    2 Posts
    377 Views
    Al HartA
    I was trying to get the function name in the trace as well. It turns out that adding this line after every function definition may work well. It displays the rotuine name as well as the file and line number. puts("TRACE: " + caller(1)[0].to_s) if $rps_show_traces
  • Load an object and attached it to the pointer

    10
    0 Votes
    10 Posts
    620 Views
    S
    And it work ! Thank y'all for your help...
  • Latitude/longitude not working ?

    3
    0 Votes
    3 Posts
    380 Views
    Didier BurD
    Thanks a million TIG
  • The results of "line.strip"

    3
    0 Votes
    3 Posts
    248 Views
    honoluludesktopH
    Tom, Thanks, I previous looked at that page, and tried to correct my code, but couldn't make it work. Guess it's another case where I am asking the wrong question. It's late, I will take another stab at it tomorrow. Except for speed, parsing, layers, block names, and nested blocks the plugin is (beta) usable. [image: Mkj1_temp09.jpg] This is a import of a Dxf file. The coding is very basic, but modular enough to add other Dxf features in the future.
  • Different styles

    3
    0 Votes
    3 Posts
    268 Views
    D
    mm. a shame. would be good to ask the google team to enable this option. no? thanks for replying
  • To space or not to space ".add_circle[@entity[0]...."

    3
    0 Votes
    3 Posts
    204 Views
    honoluludesktopH
    OK, thanks.
  • Create a group and manipulate add geom

    11
    0 Votes
    11 Posts
    861 Views
    S
    Perfect I made a stupid mistake I investigate not thanks a lot
  • Down to Top traversal

    6
    0 Votes
    6 Posts
    280 Views
    thomthomT
    Yea - you'd need to keep store the path to where you found the group in the first place.
  • Running SketchUp with command line redirection

    14
    0 Votes
    14 Posts
    3k Views
    Al HartA
    All this work trying to redirect output led me to come up with a ruby script which will redirect output, and flush the output file. See: http://forums.sketchucation.com/viewtopic.php?f=180&t=31160
  • How to add entities to a nested group?

    32
    0 Votes
    32 Posts
    1k Views
    D
    YAY! Thanks a ton thomthom, your solution works.
  • UI.messagebox "beep"

    20
    0 Votes
    20 Posts
    979 Views
    thomthomT
    @runnerpack said: @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 Doh! I swear there's a little brain-gnome that intercepts and swaps words before they reach the hands...

Advertisement