ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • To_1 conversion method

    6
    0 Votes
    6 Posts
    209 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
    14k 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
    208 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
    90 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
    569 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
    490 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
    262 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
    472 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
    405 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
    561 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
    802 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
  • Dialog - Simple WebDialog Communication Underware

    17
    0 Votes
    17 Posts
    4k Views
    Dan RathbunD
    Got another 'jewel' for the WebDialog list of treasure's: If you want to have the nice XP styled 'themed' controls (buttons, scrollbars, tabs, etc.), instead of the old ugly Win 3.x style, there's a META tag to put in the HEAD section. This 'formally' is known as MS Common Controls ver 6 (where the old ver was 5.) These controls are housed in comctl32.dll, which shipped with XP. (Look at properties to see product ver, not file version.) here's the tag: <!-- This tells the HTML frame to use MS Common Controls ver 6+ if available --> <!-- (also known as XP style themed controls.) .HTA files always NEED this. --> <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes"> For more info, see Using Visual Styles with HTML Content on page: http://msdn.microsoft.com/en-us/library/ms997646.aspx#xptheming_topic11 ..and BTW if ya' wonderin' why SU doesn't use ver 6 controls in their dialogs, it's because they didn't turn them 'on' (as a dependant assembly,) in the Sketchup.exe manifest. A holdover from preXP days I imagine. I'm running SU with them ON, but there are some display issues with the brown buttons on the left of the status bar (no images,) as well as few other things. [See post in Google groups, Technical Issues if interested. Have forwarded a 'bug' report to Google as well. Perhaps the next version, they'll have all the controls updated seeing as how they only support XP and higher.] .
  • WebDialog help - hide scrollbars

    31
    0 Votes
    31 Posts
    6k Views
    Dan RathbunD
    @newone said: If so, why does it renders buttons so old-way? Sometimes Standards Compliant mode on MSIE turns MS Common Controls back to the old 'unthemed' set (they look like old Win 3.x ugly controls.) See my post in the other WebDialog thread for a META tag that goes in the HEAD section. Sometimes it can turn the 'XP themed' ver 6 controls back on. I don't know if they work in Strict mode, but the tag should work for Tranistional mode. http://forums.sketchucation.com/viewtopic.php?f=180&t=22698#p196706
  • UI.set_toolbar_visible

    8
    0 Votes
    8 Posts
    459 Views
    thomthomT
    http://forums.sketchucation.com/viewtopic.php?f=180&t=21156 Just linking various related threads together for other people looking for the same topic.
  • REQ: THICKEN ??

    3
    0 Votes
    3 Posts
    265 Views
    J
    ahhh, thank you...
  • Anyone with IE7 willing to do a quick test for me?

    8
    0 Votes
    8 Posts
    273 Views
    thomthomT
    Mac? I've got a Mac Mini with OSX10.4 which I've used to try my plugin on. Just wanted to confirm a real IE7 system to see how the webdialog worked.

Advertisement