ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • [Ruby API] Bug Mac - Sketchup.get_resource_path

    4
    0 Votes
    4 Posts
    175 Views
    D
    SU v8 and v7 on my mac edit, it returns a path to nowhere... but I knew I had it somewhere... matPath = (ENV[ "IG_ROOT"]).dup << "/English.lproj/Materials.strings" works on v8 and v2013 at least john
  • Ruby Style Guide

    3
    0 Votes
    3 Posts
    245 Views
    renderizaR
    Wow nice find...thanks!
  • OSX MDI confusion

    7
    0 Votes
    7 Posts
    639 Views
    D
    that does seem to work if you want a persistent reference you can add an xattr to the active model file... def only_iff model = Sketchup.active_model modName = Sketchup.active_model.title modPath = Sketchup.active_model.path modEntID = Sketchup.active_model.definitions.entityID case when modName.to_a.length == 1 then remove_old = %x(xattr -d test "#{modPath}" 2>&1) if (%x(xattr -p test "#{modPath}" 2>&1)).length > 0 perSistent = %x(xattr -w test "#{modEntID}" "#{modPath}" 2>&1) puts modEntID # but could be any persistent reference when modName.to_a.length == 0 then Sketchup.send_action('saveDocument;') UI.messagebox "Save model and retry" end #case end # def only_iff then in another session you can check if it's been thru your mill before. modPath = Sketchup.active_model.path %x(xattr -p test "#{modPath}" ) just thoughts john
  • Reusing menus - what is going on?

    14
    0 Votes
    14 Posts
    551 Views
    T
    @thomthom said: So it appear that it only work if it's all done within one action. Which is why my menu plugin works when SketchUp starts up, because the all the plugins are loaded within the same "loop" (??). ... This is awkward and annoying. I can probably make it work, what I want to do, but it'll hard to debug as I need to actually restart SketchUp every time... http://sketchucation.com/forums/viewtopic.php?f=180&t=52489&start=30 Yes its a great way to waste more time! Its enough to make one take up quantum computing instead
  • Loading csv giving error

    6
    0 Votes
    6 Posts
    338 Views
    TIGT
    The FILE works if you run the code from the .rb file loading. The way you have it set should work if the file 'Price_lookup.csv' is in the same folder as the .rb... You code has an error: csv_text = File.read('Price_lookup.csv') should be say csv_text = IO.read(csvfile) giving you an array of the lines. I'm not sure about how you are parsing the file data you read in... BUT once you successfully get the data in, then temporarily 'output' it to the opened Ruby Console to check it's as you expect, with: puts csv_text and showing hidden characters like \n etc p csv_text added in after the data is read-in...
  • Layer Material

    22
    0 Votes
    22 Posts
    4k Views
    jiminy-billy-bobJ
    Up ?
  • Align component boundingbox to global axis

    5
    0 Votes
    5 Posts
    301 Views
    M
    You are a good man Chris. ....as Rosanne Rosana Dana once so eloquently said.....never mind.
  • GMSH exporter

    14
    0 Votes
    14 Posts
    3k Views
    bomastudioB
    @djskippy said: Hi Bomastudio, Some time ago I've written an export script from Sketchup to Gmsh. Sketchup Groups are exported as Volumes in Gmsh Sketchup Faces are exported as plane surfaces in Gmsh Sketchup Edges are exported as lines in Gmsh Sketchup Vertices are exported as points in Gmsh The script handles nested groups and applies all transformations to the points in Gmsh Inner faces are exported correctly. It even exports text entered in Sketchup (not 3D text). The only thing this script doesn't do is: Export circles and arc's as Gmsh circles, it now just exports them as lines and points (that's how Sketchup see's them). To correct this you'll need to take a look a IGES_EXPORT and how it exports circles, cylinders and cones. Thanks!!!!! I was looking for this plugin for a long long time!!!!
  • Aborting a .rbz install

    16
    0 Votes
    16 Posts
    428 Views
    danielbowringD
    @driven said: I'm under the impression Windows will see it as a space and error out Error: #<NoMethodError: undefined methodwindows' for #Object:0x56b89ec>` Depends what encoding you save it in. Western (Windows 1252) gives this: Error; #<SyntaxError; (eval);5231;in `load'; path/to/nbsp.rb;1; Invalid char `\240' in expression> UTF-8, however, will load and work fine windows use = "o.~" puts "Success #{windows use.inspect}" # -> load 'path/to/nbsp.rb' Success "o.~" true Note: Browsers will replace the character in question (160, "non-breaking space") with a regular space (32, "space"), but I did correct for this for this test.
  • Transforming an object with SketchUp Ruby

    3
    0 Votes
    3 Posts
    2k Views
    K
    Aerilius You are a star ! Thanks a million Kevin
  • Launch Sketchup from inside AOO/LO Draw or Writer?

    3
    0 Votes
    3 Posts
    385 Views
    V
    RE OLE....I know about OLE but its hap hazard in AOO/LO....problematic RE embed picture....Yes...do that now all the time...very manual...doesnt lend well to update and managing versions. Since AOO/LO draw is not much more than impress (abstract shapes, simple diagrams, 2D) just curious if anybody was looking to take the productivity package to the next level. AOO/LO filters for Visio are real weak...so that is not an option. Could look at inkscape,etc...but those seem to be more about making logos and icons. Could look at vpython since there is a python bridge but vpython is really used for scientific visualization (relatevely crude colors and shapes, no real library of shapes to build off of, etc). so just curious.
  • Export images to saved file location with file name

    15
    0 Votes
    15 Posts
    459 Views
    B
    I have run into an issue when I'm working on the same image on two different computers - when exporting the Sketchup image, the Width & Height are locked (when one is edited, the other automatically matches that computer's viewport ratio). I am trying to find a way to export an image with independently filled in Width and Height resolutions. This seems to be the closest Ruby I could find to fixing my issue. Is there any way to modify this to get what I'm looking for? I export so often that I would like to create a button on a new toolbar to keep at the top of the screen, instead of entering the Ruby Console every time. Is there any way to do this?
  • Need a plugin?

    11
    0 Votes
    11 Posts
    373 Views
    pilouP
    No problem! I'ts my pleasure! ...et le français québécois est encore meilleur que celui du vieux continent!
  • Check if group of entities exist, if true delete them

    5
    0 Votes
    5 Posts
    437 Views
    D
    Thanks for your help everyone! TIG's advice did the trick. Also thomthom, thank you for pointing out your editable 3d text plugin. I've wished it existed for a long time. Awesome work!
  • Anyone up to this??

    11
    0 Votes
    11 Posts
    400 Views
    bsintzelB
    Great Canadian beer, Beaver tails and hockey....man, what a country we live in. Happy Canada Day
  • Failed saving image on plugin directory. (solved)

    3
    0 Votes
    3 Posts
    180 Views
    renderizaR
    Hi, Doing some research I found this post by TIG and it was pretty much what I was looking for. http://sketchucation.com/forums/viewtopic.php?p=281017#p281017 Thanks!
  • [Code] Printing color range as grid for preprint checking

    11
    0 Votes
    11 Posts
    974 Views
    atelierpaarA
    Hello Tig, thanks for looking into it. Just the SU Material file "colors" contains 310 Colors. Each Color has to be selected and applied to some surface in order to get the color into the model. It`s the tedious manual work that discouraged to make a color guide. Is there perhaps a another way of mass-loading materials into a model ? Uli
  • Safe place to store user-defined parameters

    114
    0 Votes
    114 Posts
    11k Views
    thomthomT
    Norwegian XP - User "Tæst": ` ENV.to_hash { "PROCESSOR_ARCHITECTURE"=>"x86", "HOMEDRIVE"=>"C:", "CLASSPATH"=>".;C:\Programfiler\Java\jre1.6.0_07\lib\ext\QTJava.zip", "APPDATA"=>"C:\Documents and Settings\T\221st\Programdata", "USERPROFILE"=>"C:\Documents and Settings\T\221st", "TMP"=>"C:\DOCUME~1\TST~1\LOKALE~1\Temp", "SESSIONNAME"=>"Console", "ProgramFiles"=>"C:\Programfiler", "PROCESSOR_REVISION"=>"0d08", "PROCESSOR_LEVEL"=>"6", "CommonProgramFiles"=>"C:\Programfiler\Fellesfiler", "USERNAME"=>"T\221st", "PROCESSOR_IDENTIFIER"=>"x86 Family 6 Model 13 Stepping 8, GenuineIntel", "OS"=>"Windows_NT", "FP_NO_HOST_CHECK"=>"NO", "windir"=>"C:\WINDOWS", "SystemRoot"=>"C:\WINDOWS", "PATHEXT"=>".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH", "ALLUSERSPROFILE"=>"C:\Documents and Settings\All Users", "USERDOMAIN"=>"WEEBLE", "NUMBER_OF_PROCESSORS"=>"1", "HOMEPATH"=>"\Documents and Settings\T\221st", "TEMP"=>"C:\DOCUME~1\TST~1\LOKALE~1\Temp", "SystemDrive"=>"C:", "QTJAVA"=>"C:\Programfiler\Java\jre1.6.0_07\lib\ext\QTJava.zip", "Path"=>"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\FELLES~1\SONICS~1\;C:\Programfiler\Fellesfiler\Autodesk Shared\;C:\Programfiler\backburner 2\;C:\Programfiler\Fellesfiler\Roxio Shared\DLLShared;c:\Programfiler\Microsoft SQL Server\90\Tools\binn\;C:\Webdev\MySQL\MySQL Server 4.1\bin;C:\Programfiler\QuickTime\QTSystem\", "LOGONSERVER"=>"\\WEEBLE", "ComSpec"=>"C:\WINDOWS\system32\cmd.exe", "COMPUTERNAME"=>"WEEBLE" } TT::System.local_data_path C:\DOCUME~1\TST~1\LOKALE~1\PROGRA~1 ENV['TEMP'] C:\DOCUME~1\TST~1\LOKALE~1\Temp File.dirname( ENV['TEMP'] ) C:\DOCUME~1\TST~1\LOKALE~1 TT::Win32.get_folder_path_ansi( TT::Win32::CSIDL_LOCAL_APPDATA ) C:\Documents and Settings\Tæst\Lokale innstillinger\Programdata TT::Win32.get_short_folder_path_ansi( TT::Win32::CSIDL_LOCAL_APPDATA ) C:\DOCUME~1\TST~1\LOKALE~1\PROGRA~1 path = TT::Win32.get_short_folder_path_ansi( TT::Win32::CSIDL_LOCAL_APPDATA ) C:\DOCUME~1\TST~1\LOKALE~1\PROGRA~1 File.exist? path true file = File.join( path, 'test.txt' ) C:\DOCUME~1\TST~1\LOKALE~1\PROGRA~1/test.txt File.open( file, 'w' ) { |f| f.puts 'Hello World' } nil File.exist? file true File.size file 13` PROGRA~1 in the local appdata folder is just a coincidence as the Norwegian work is very similar to English. C:\Documents and Settings\Tæst\Lokale innstillinger\Programdata It'd be nice to have this tested on a computer with very different language.
  • Download skp files directly into Sketchup

    14
    0 Votes
    14 Posts
    3k Views
    thomthomT
    Yea, I also found awkward ways to drop files to the WebDialog - but it's so awkward that I won't bother making a public release for it. It'll just be confusing - and defeat the purpose of trying to make an easy drag and drop feature...
  • Save Model using Ruby API on Windows

    7
    0 Votes
    7 Posts
    666 Views
    Dan RathbunD
    @conchords said: @chris fullmer said: From that same thread, Dan mentions you can use this command to simulate the actual File > Save: Sketchup.send_action( 57603 ) Then you could use the regular Model.save for Mac and the send_action for PC's. I've not tried it, but it might be a solution. That worked great, thanks. Actually at that time I did not know of the cross-platform send action string, "saveDocument:" ... ... so you can just use Sketchup.send_action( "saveDocument:" )

Advertisement