🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
  • Possible to change component size to a fixed value?

    4
    0 Votes
    4 Posts
    458 Views
    thomthomT
    You could edit the tranaformation matrix directly...
  • Accessing System Preferences from Ruby

    2
    0 Votes
    2 Posts
    288 Views
    TIGT
    This PC only code returns the keys and values for any valid Registry entry. See the notes at the end for usage require 'sketchup.rb' module TIG ### for PC use only ! def self.getregentries(key="") key.tr!("/","\\") cfile=File.join(ENV["TEMP"], "regentries.cmd") tfile=File.join(ENV["TEMP"], "regentries.tmp") f=File.open(cfile, "w") f.puts("reg query \""+key+"\" /f \"*\" /s > \""+tfile+"\"") f.close UI.openURL("file;///"+cfile) sleep(0.1) until File.exist?(tfile) sleep(0.1) lines=IO.readlines(tfile) hents={} lines.each{|line| line.chomp! next if line.empty? or line=~/#{key}/ or line=~/^End/ ent=line.split(" ") hents[ent[1]]=ent[3] } File.delete(tfile)if File.exist?(tfile) File.delete(cfile)if File.exist?(cfile) return hents end end ### Example;- ### ents=TIG.getregentries "HKEY_CURRENT_USER\\Software\\Google\\SketchUp8\\File Locations" ### Find the ents entry 'by name' thus; ### ents["Components"] >>> 'C;\Program Files\Google\Google SketchUp 8\Components\' ### Returns 'nil' if there is no key. ### Read the notes at the end on how to get a key/value. Copy/paste code into a file called say TIG-getregentries.rb in the Plugins folder, to use type the example in the Ruby Console OR inside a script...
  • [SOLVED] Booleans operations available to free SU?

    9
    0 Votes
    9 Posts
    652 Views
    jolranJ
    Was gonna post a snippet this morning but you guys did the work for me So I see John, you got an error "is a Pro only feature." That pretty much sums it up. Like Tig also suspected. Dan said. @unknownuser said: Makes sense.. otherwise we'd be able to write Pro feature custom tools for Free Yeah, thats why I posted the question. Being a PRO user I momentarily took this method for granted when I did not receive an error message in my code. Thanks everyone involved for clearing this up. Maybe Google should put PRO label for methods like this after the 8+ in the API.
  • Why Freemium Doesn't Work

    4
    0 Votes
    4 Posts
    218 Views
    chrisglasierC
    I see this free business as a way to create new business activities for yourself. An off-the-wall example - if you wanted to get into publishing (a very long time ago) you would have needed to invent the alphabet or suchlike. Obviously, you could not charge for this at the beginning because no one had any idea what to do with it nor later because it had already been freely copied and integrated. But it had served your initial purpose establishing your name and fame in the new highly competitive and expanding market you created. Like Ford or Kodak perhaps. Moreover always one step ahead you were able to invent new-alphabet based ventures that people were only too happy to pay for. Isn't this what Google are doing with free search and advertising. Could this be the basis for free Sketchup - models as the means of communication. The new hieroglyphs? This pay-for premium services is all well and good but rather weak-kneed - a bit of a side show really. PS great 'where's the coffee story'!
  • Need to add keyboard shortcuts to Scenes

    35
    0 Votes
    35 Posts
    7k Views
    K
    @thomthom said: And my impression is that they already have this software package - they just needed the keyboard shortcut controller for the scenes... This is correct.
  • Win32ole issues

    12
    0 Votes
    12 Posts
    952 Views
    daikuD
    No Bugsplats at all.
  • Global vertex position fails, when I pull a face

    9
    0 Votes
    9 Posts
    210 Views
    thomthomT
    Note that the method doesn't transform the point itself - but returns a copy.
  • "SketchUp Ruby Cookbook"

    3
    0 Votes
    3 Posts
    638 Views
    Dan RathbunD
    We have one here at SCF: [Code Snippets] ... although it doesn't have the word "cookbook" in the title.
  • "something minor is messed up in your model"

    7
    0 Votes
    7 Posts
    2k Views
    TIGT
    I think that the default-layer is now called 'Layer0' in all locales... BUT there was a time that it was named differently for each locale-version. So entity.layer=nil WAS [still is] the safe and correct way to default the object's layer, without recourse to using a 'name' at all... Similarly entity.material=nil and face.back_material=nil will also default those, without recourse to using a 'name' at all...
  • Sketchup Web Exporter

    26
    0 Votes
    26 Posts
    4k Views
    D
    [image: 1pMs_2011-12-3002.08.07am.png][image: Vxb8_2011-12-3002.08.28am.png][image: UIBX_2011-12-3002.08.41am.png] This is my actual selection and the resultant output file ready for playback in SU.
  • Level of a component

    3
    0 Votes
    3 Posts
    262 Views
    S
    @boris vaisman said: Hi everybody, I'm working on a plugin which exports all the components in a csv file and i need the property that gives the level of the component. Hi Boris Your English is great however I can think of at least four meanings for the english word "level" that you might mean. If Davids answer doesnt help perhaps you could indicate which(if any) of these you mean? In a building : "level" can refer to the floor or story of a multistory building. Example "The entrance is on level one, the kitchen is on level two." means the entrance is on the bottom story and the kitchen on the second story/floor. In a hierarchy : "level" can be used like David has to refer to the how far "up" the hierarchy / tree your object is. In ?physics/geometry/building : "level" can mean "flat" or perfectly horizontal/vertical. Example "That window ledge is not level" means the window ledge is not perfectly horizontal. 4 In CAD programs : "level" might refer to a "layer" . Example "Draw your house floorplan on level 0 and then draw 3D elements on other unique layers eg level 1 - 20". cheers Paul
  • [Code] Selection dependant menu item macros

    3
    0 Votes
    3 Posts
    1k Views
    Dan RathbunD
    Your welcome. The example is very basic.. and only adds one item to the menus. The user can expand it to add more than one item to the menus within the same file. You need not have a separate file for each menu item. Just add additional methods into the Proxy class section, and additional context_menu.add_item calls into the context menu handler section.
  • Draw lines using screen coordinates (help)

    6
    0 Votes
    6 Posts
    897 Views
    Dan RathbunD
    @unknownuser said: i don't learn that way.. i wish all those api things had some examples in there (i.e.- type this and watch what happens The API entry for Entities#add_edges() has a straightforward and simple example to add edges to a Sketchup::Model object. (My point of number 1, in the previous post, is that only Sketchup::Entity subclass objects, can be added into the model's DOM (Documnet Object Model heirarchy.) Sketchup::Drawingelement is a subclass of Sketchup::Entity, and the Sketchup::Drawingelement subclass objects are what you "see" in a model, such as Edges, Faces, etc. @unknownuser said: the api documentation probably makes a great reference for someone that already understands the basics (which i don't) see and follow: Ruby Newbie's Guide to Getting Started
  • Toolbar Icon checked_unchecked

    8
    0 Votes
    8 Posts
    301 Views
    G
    @jim said: I do not think there is an infinite loop - the repeating output is because the validation proc is being called by SketchUp very frequently. frequently as much they MF_check, MF_unchek toolbar items. As long as CustomToolbars are open i guess they are repeading output. @jim said: Sure. I like the idea of disappearing toolbars. Mercy, Jim. I'll post free for noel. I hope you customize it as you like it. All yours. I'll drop item.cmd validation from code. sry that.
  • [Question] Icon pressed

    15
    0 Votes
    15 Posts
    1k Views
    Dan RathbunD
    @gultekinmg said: inject that into your code..at "icon_observer.rb" Code for the validation of the icon. def self.obs(id) # ID = Id of your Icon action >> p "This is SU Bug.." and watch them scroll all the way eternity.... NO do NOT do this ! ONLY determine if the return value of the validation proc is MF_CHECKED, MF_GRAYED or MF_ENABLED. Keep conditional evaluations (and any other,) at the bare minimum. ALL visible toolbar validation procs are called by the Sketchup application's main loop, each time the user interface needs to be redrawn (including each time the mouse is moved !!) Menu validation procs are called when a specific menu needs to be displayed.
  • PolygonMesh#normal_at == [0, 0, 0]?

    10
    0 Votes
    10 Posts
    424 Views
    J
    Just looking for a shortcut way to get vertex normals. I know it can be done in Ruby, but was hoping SketchUp did it faster when using a PolygonMesh.
  • [Question] multi document interface and Tools

    7
    0 Votes
    7 Posts
    707 Views
    A
    Thanks, that's very helpful (and I was also wondering why such observers don't exist, good feature request). I'll have to consider this for my webdialog callbacks.
  • Changing units format via ruby

    5
    0 Votes
    5 Posts
    2k Views
    jeff hammondJ
    sweet! exactly what i was looking for. thank you sir
  • Mimic 'select' in custom tool

    3
    0 Votes
    3 Posts
    163 Views
    Dan RathbunD
    An easier way is to make menu macros for the context menus (the right-click popup and the Edit menu's selection submenu.) FYI: I posted a boilerplate sample
  • [Question] how to add entities to componentdefinitions

    7
    0 Votes
    7 Posts
    570 Views
    TIGT
    You already know how to add objects to an '.entities' collection [i.e. for model/active_/definition/group]. Make a new definition, then use defn.entities.add_instances of the other three [already made] components as you wish... OR make the containing definition, then make gp=defn.entities.add_group() and add geometry etc to gp.entities, make the group into a component and then adjust its definition name etc as needed - repeat three times for the contained instances...

Advertisement