⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Hide Toolbars On Load

    16
    0 Votes
    16 Posts
    3k Views
    Dan RathbunD
    @simonstaton said: ...now is there one of these [methods] that I can make that will hide the getting started toolbar on load? ...[snip]... ANSWER: Yes there is ! The following code hides the "GettingStarted" toolbar at any time, whether it's docked or floating. status = UI.set_toolbar_visible("GettingStarted", false)
  • Looking for a plugin to automate material colors

    5
    0 Votes
    5 Posts
    283 Views
    G
    @chris fullmer said: The button is called color all the same or something like that. Here's a screen grab that shows it. Hope it helps, let me know if it does not do quite what you were hoping for. [attachment=0:3e6t77oc]<!-- ia0 -->all_same.png<!-- ia0 -->[/attachment:3e6t77oc] Chris Ahh, ok, now I see what you're talking about! I followed your instructions and the model did indeed turn all white, but it's lacking its textures, unfortunately. Let me show you an example of what I'm looking to do: I model with color data and presentation purposes: [image: sketchup%20texture%20with%20color.jpg] For certain rendering effects and photoshop post-processing, it's VERY handy to keep the textures, but have them have no saturation and full brightness: [image: sketchup%20texture%20no%20color.jpg] There may be no easy way to do this other than old-fashioned elbow grease. It just gets very redundant, very quick to manually adjust each material
  • DHTML dialog boxes

    5
    0 Votes
    5 Posts
    328 Views
    thomthomT
    @gruff said: Okay... So are there any books that can walk me through creating a simple hello world web dialog for SketchUp ruby. I don't think you'll find any which directly relates to Sketchup. But any book that talks about web applications will work.
  • Built-in JSON in Internet Explorer 8 IE8

    8
    0 Votes
    8 Posts
    1k Views
    thomthomT
    Doing some more testing. I added this meta tag to a Strict document: <meta http-equiv="X-UA-Compatible" content="IE=8"/> The user-agent string still reported IE7, but the new CSS feature outline worked. If I remove the meta tag the outline property doesn't render. And just to make sure, I used document.documentMode to get the render mode, with the meta tag it reports IE8, without IE7. So this is another nail in the coffin for the user-agent string <- mostly pointless and highly unreliable. I attached the test code I used. Extract it to your plugins menu and type this into the Console to open up a webdialog: dlg = UI;;WebDialog.new("Test") dlg.set_url Sketchup.find_support_file "test.html", "Plugins/" dlg.show It will first report IE7 mode. But remove the comments around the META tag and see how the blue outline now renders and the JS reports IE8 mode. You can also see the different behaviour from regular IE windows. test.zip
  • Attention script writers - GSU selection nodes....

    4
    0 Votes
    4 Posts
    730 Views
    thomthomT
    Some might not be able to - as they use custom inference.
  • To_1 conversion method

    6
    0 Votes
    6 Posts
    258 Views
    J
    Good catch!
  • Mathematics related problem

    23
    0 Votes
    23 Posts
    2k Views
    M
    ahh notepad++ old friend.. i used to do my c++ programming on it and then take it to university to test it! haha i think i am gonna take the night off and start over with this tomorrow might crack something.. good night world!
  • How to read the windows registry?

    18
    0 Votes
    18 Posts
    15k Views
    Al HartA
    This ruby uses Win32API to read the registry, and works on Vista. But it may not work if you are not an Administrator (who knows). It is looking for the entry: HKEY_LOCAL_MACHINE\SOFTWARE\Render Plus Systems\IRender_nxt_location So you will have to change it to the registry key you are looking for. class Your_class def self;;get_reg_functions @@RegCloseKey = Win32API.new('advapi32', 'RegCloseKey', 'L', 'L') if @RegCloseKey == nil @@RegOpenKeyEx = Win32API.new('advapi32', 'RegOpenKeyEx', 'LPLLP', 'L') if @RegOpenKeyEx == nil @@RegQueryValueEx = Win32API.new('advapi32', 'RegQueryValueEx', 'LPLPPP', 'L') if @RegQueryValueEx == nil #@@RegCreateKeyEx = Win32API.new('advapi32'', 'RegCreateKeyEx', 'LPLLLLPPP' 'L') end#def def self;;get_registry_entry(key, sdefault = "") #trace("key; %s",key) get_reg_functions key.tr!('/','\\') sret = sdefault # strip of section spos = key.Find('\\') if (spos < 1) do_error("Cannot parse registry key %s - Key must contain a backslash\n",key) return(sdefault) end#if firstpiece = key.Left(spos) mainkey = key.Mid(spos+1) if (firstpiece == "HKEY_LOCAL_MACHINE") root = HKEY_LOCAL_MACHINE elsif (firstpiece == "HKEY_CURRENT_USER") root = HKEY_CURRENT_USER else printf("Registry key must start with HKEY; %s",key) return(sdefault) end#if # strip off final key spos = mainkey.ReverseFind('\\') if (spos < 1) printf("Cannot parse registry key %s - Key must contain a backslash\n",key) return(sdefault) end#if lastpiece = mainkey.Mid(spos+1) mainkey = mainkey.Left(spos) phkey = [0].pack('L') # a 4 byte string of 0's go get handle ret = @@RegOpenKeyEx.call(root, mainkey, 0, KEY_READ, phkey) printf("ret; %s mainkey; %s\n",ret,mainkey) if (ret != 0) printf("key not found; %s\n",key); return(sdefault) end#if hkey = phkey.unpack('L').first # convert stron pointer to integer # create a buffer for the result buf = 0.chr * 1024 size = [buf.length].pack('L') # store size of buffer ret = @@RegQueryValueEx.call(hkey, lastpiece, 0, 0, buf, size) if (ret != 0) printf("location not found; %s\n",key); return(sdefault) end#if # if ret == ERROR_MORE_DATA, then we should call again with a larger buffer @@RegCloseKey.call(hkey) sret = buf.nstrip # stop at 0 byte printf("sret; %s length; %d key; %s\n",sret,sret.length,key) return sret end#def # this returns the location without a slash def self;;find_application_folder(smodule) #skey = sprintf("HKEY_LOCAL_MACHINE\\SOFTWARE\\Render Plus Systems\\%s_location", smodule) skey = sprintf("HKEY_LOCAL_MACHINE/SOFTWARE/Render Plus Systems/%s_location", smodule) sloc = get_registry_entry(skey) printf("sloc; %s from skey; %s\n",sloc,skey) if (sloc && FileTest.exists?(sloc)) sloc.tr!('/','\\') #printf("RETURNING 1 sloc; %s\n",sloc) return(sloc) if sloc != nil end#if printf("Registry entry not found; %s\n", skey) return nil end#def end#class Your_class Your_class;;find_application_folder("IRender_nxt") read_registry.rb
  • Trace() - display message with traceback to caller

    3
    0 Votes
    3 Posts
    4k Views
    Al HartA
    @thomthom said: :thumb: Good stuff. Though, I have a thought: Why not define the trace method in a Trace class, and then include the class to the methods you want. That way you don't have multiple copies all over the place? Good idea, I could include it in a module of functions. But I would still have to distribute the trace module with each application. And there might be a problem with versions. When a user had installed more than one RPS application, say a new version of A and and old version of B, then A might wind up inheriting from the B version of the module, if the B version was loaded into SketchUp after the A version. At one point we considered having a common set - called RPS_common. But still the problems of installing and uninstalling became difficult.
  • Making components...

    3
    0 Votes
    3 Posts
    237 Views
    TIGT
    Alternatively just make a group and add entities to it... then turn it into a component when you are done... ### you'll need to define stuff like entities, pt1/2 etc earlier on - it's skipped here for brevity group=entities.add_group() group.entities.add_line(pt1,pt2) ### add as much as you want... instance=group.to_component definition=instance.definition definition.name="My Definition's Name" instance.name="My Instance's Name" tr=Geom;;Transformation.new(ptxyz) ### ptxyz = new insertion point, as it'll be located at the ORIGIN by default instance.transform!(tr) ###to move or even rotate/scale it as needed ### etc ### to now add further stuff to definition use### definition.entities.add_...
  • .execute_script on Mac SU6

    3
    0 Votes
    3 Posts
    119 Views
    thomthomT
    @cphillips said: I think that example shows that a script with quotes in it now works. That was one of many problems with execute_script on Mac. Ah, so I guess I really should test my dialogs on Mac SU6 and not assume WinSU6 to be the same.. sigh
  • Mac OSX and plugin problems

    21
    0 Votes
    21 Posts
    938 Views
    honoluludesktopH
    Thanks, I must have done something s****d, like copy the file from v6.x, when I didn't see it in the v7.x plugin folder.
  • Error in code

    7
    0 Votes
    7 Posts
    557 Views
    J
    Get comfortable with Ruby, then apply that to the API documentation. Read other people's code, and most importantly - try things yourself, and ask questions when they don't work.
  • (request) What I (personally) would love for SU

    3
    0 Votes
    3 Posts
    279 Views
    D
    UVwrapping would be a dream come true in sketchup. Hell, even cubic, cylindrical and spherycal maping would already be great.Amazing how we are able to survive for so long without any of those...(maybe thanks to whaat's plugin...)
  • Plugin Menu &quot;Selection&quot;

    12
    0 Votes
    12 Posts
    534 Views
    kenK
    Tig Thanks for the info and the help. However, I found the script I was looking for, ConsDeleteContext.rb, which is one of your scripts. I just forgot that it is a context selected script. So now I am working again. Maybe I will make a small database with all the scripts that I have or can find, and enter just what they do, who made the script and how to activate the script. As soon as I get the time. Tig, again thanks for your scripts. Ken
  • ImageProfile script now available

    12
    0 Votes
    12 Posts
    2k Views
    F
    Rick, can you show me a screenshot of this bag with the "high" quality cutout please? this is not the quality I need for my work... I'm thinking trees/flowers, etc. [image: JwNW_golfbag-4-low.jpg]
  • Ruby variables

    8
    0 Votes
    8 Posts
    1k Views
    honoluludesktopH
    OK, I think I figured it out: module module.method01 . data=module.module02(data) #call method02 . end module.menthod02(data) . data=..... end end #menu I should have known that:-) Now, whats a CLASS?
  • Similar Group Finder - Script beginning needs testing

    13
    0 Votes
    13 Posts
    654 Views
    TIGT
    I use... class Float def =~(num2,tol=10000) num1=(self*tol).to_i num2=(num2*tol).to_i return true if num1==num2 return nil end end #class Float
  • A face divider

    7
    0 Votes
    7 Posts
    637 Views
    B
    Hello my name paan, can you find or make sketchup plugin that can detect the edge of the texture and turn into that shape . It's more like make the rectangle turn into the shape of the texture that have transparent background . sorry for my bad English and i hope you understand what i meant and if you find it don't forgate to send an email to me at: fan_mustar@yahoo.com.my
  • Getting global coordinates

    5
    0 Votes
    5 Posts
    876 Views
    B
    TIG, thanks a lot! The script worked very well. So, I will include it inside the main script. I wont forget to speak folds its aid. Really very thanks Sérgio

Advertisement