sketchucation logo sketchucation
    • Login
    1. Home
    2. RichMorin
    3. Topics
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 41
    • Posts 104
    • Groups 1

    Topics

    • RichMorinR

      When (and why) might "file_loaded?" be needed?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      237 Views
      TIGT
      It's there to stop more than one instance of the plugin loading into the menu/context-menu etc. If you hadn't added this trap then this might happen if you typed load "MyPlugin.rb" after you have already got it loaded - e.g. automatically at startup. It's not going to have to stop these potential duplicate menu items unless you try to 'load' the script more than once - e.g. while you are testing it, or perhaps when you have a script in a sub-folder that doesn't auto-load, but it might be loaded by another script [that is itself already loaded] under certain circumstances, and potentially these circumstances might occur more than once in that session - but you only want the one menu/context/toolbar item...
    • RichMorinR

      PBI - emulate WebDialogs in a browser?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      1k Views
      RichMorinR
      @morgan_greywolf said: Sure, I'll take a look at it. I'm running SU8 on Linux/Wine. Great. You can get started with the proxy server and the test page; send me a note off-list (rdm@cfcl.com) letting me know what you find out. As soon as I have my example plugin ready for Alpha testing, I'll let you know. FYI, the plugin no longer sits in a read loop. Instead, I use UI.start_timer to perform periodic scans of the input directory. This seems to work quite nicely, but it does require SU8, because it's using a sub-second interval. Also, I'm still hoping for a CygWin and/or native Windows tester!
    • RichMorinR

      Working around "location=", for debugging

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      16
      0 Votes
      16 Posts
      1k Views
      RichMorinR
      @dan rathbun said: I was under the impression that the code block of show() and show_modal() did not work on the Mac. Has this been fixed on SU 8.x ?? Dunno, in general, but a quick experiment worked for me. Then again, I was only setting a single variable. -r
    • RichMorinR

      Mechanizing the model upload process?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      238 Views
      Dan RathbunD
      You'd have to first export I'd think, via the Sketchup API. Then some kind of automation, perhaps thru a webdialog. (I do not see a specific 3Dwarehouse APi on Google API site.) Try posting a query here: http://sketchup.google.com/3dwarehouse/forum
    • RichMorinR

      JS loading problem under Mac OS X SU

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      14
      0 Votes
      14 Posts
      2k Views
      Dan RathbunD
      @richmorin said: It turns out that the relative paths to my library JS (and probably CSS) were working under the browsers, but not under SU. !@#$%^ (Thanks, Dan!) Ok that's a common booboo, nothing too bad. There's a fix we talked about in another thread where we were brainstorming how to set up a "mini" 3Dwarehouse for Eric's SketchTHIS.net website: Re: Download to Sketchup button
    • RichMorinR

      Saving components so they "open" nicely?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      327 Views
      RichMorinR
      Indeed, it turns out that calling refresh_thumbnail after the call to zoom_extents and before the call to save_as clears up the problem.
    • RichMorinR

      Getting SketchUp to play nicely with RubyGems?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      24
      0 Votes
      24 Posts
      6k Views
      Dan RathbunD
      @unknownuser said: Ruby LOAD PATHs script for (Win32)](http://forums.sketchucation.com/viewtopic.php?f)":1xbd78u2] I am trying to write a plugin for sketchup 8 using rubygems. ... About the initial load error now, whenever I uncomment the #$LOAD_PATH << "#{pre}/site_ruby/#{ver}" line (the directory containing the rubygems file among others), sketchup crashes during launch. It is NOT likely you will get a standard RubyGems to work with Sketchup. One problem may be that RubyGems redefines the Kenel.require() method, which is inherited by Object, and so inherited by all other Ruby objects. For info on RubyGems, see the Resources list under the section: TECHNICAL REFERENCES It is more probable that a special version of RubyGems would be needed for use under Sketchup.
    • RichMorinR

      Re-applying materials after scaling?

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      579 Views
      Dave RD
      .
    • RichMorinR

      &quot;Automatic SketchUp&quot; - review

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      740 Views
      Mike LuceyM
      Being totally ignorant on the subject of ruby scripting I think I will buy this book and gain some insight. It looks to be good value at $32. I also notice that the author, Matthew Scarpino, says in Chapter 1: Introduction to SketchUp Scripting For further support with SketchUp scripting, you can't do much better than http://www.sketchucation.com http://www.autosketchup.com/ [image: ht4a_AutomaticSketchUp.jpg]
    • RichMorinR

      Creating pulldown menus

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      182 Views
      TIGT
      @richmorin said: I'm not sure about the distinctions and terminology here, so: This is the dialog one gets by selecting a component and using the "Window > Component Options" menu bar item on a Mac. It's the 'Dynamic Component Options' Window/Dialog...
    • RichMorinR

      SketchUp API consultants?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      224 Views
      TIGT
      I've sent you an email... Suggest you edit your initial post to 'discombobulate' your email address [to protect it from bots] e.g. rdm_at_cfcl.com.
    • RichMorinR

      Support for data serialization formats

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      987 Views
      Dan RathbunD
      @dan rathbun said: @richmorin said: I have a bunch of configuration data that I want to serialize, write to a file, and have my plugin load. Suggestions, anyone? The 3rd, option is to use the Sketchup.write_defaultand Sketchup.read_defaultmethods to store your plugin options in the Windows Registry (win32) or Plist file (Mac). Con here is that your options must be 'flatfile' data. No multi-level data is allowed. Actually not entirely true. You can set up the text fields of your attributes anyway you wish, since it's your plugin that will use them. If it's easier, and faster for loading.. you can have 'array' fields. ie, a single attribute value can actually be a CSV list of multiple values. (You can use whatever delimiter you wish, not just comma.) del = '%' # delimiter valListString = arrayOfValues.join(del) # then assign valListString to attribute value # reading is opposite # assign attribute value to valListString arrayOfValues = valListString.split(del) # you'd need to iterate the array and convert # any number strings to numerics # see the Sketchup extenstion String.to_l Sketchup extenstion String.to_l
    • RichMorinR

      How to detect duplicate edges?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      448 Views
      TIGT
      @richmorin said: TIG- If you'll look at my code extract, you'll see that I'm already doing what you suggest. pph is a hash of "point pairs", indexed by the vertex positions (encoded as strings, to avoid object issues). However, my code isn't detecting any clashes, even though SU does (later) when it tries to save the model. That's why I suggested instead of inspecting the points you inspect the edges already made...
    • RichMorinR

      Importing and placing components

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      322 Views
      TIGT
      You have exited your Tool so the View refreshes... selectSelectionTool changes to that tool... No hack... No magic involved...
    • RichMorinR

      Setting dynamic attributes to expressions?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      5k Views
      Dan RathbunD
      You want the facecopy to intersect with the glued_to face ? This might work, untested. <span class="syntaxdefault">def get_glued_bounds_facegroup</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">ci</span><span class="syntaxkeyword">)<br /></span><span class="syntaxcomment"># Arg; ci, a component instance<br /># Return nil if ci is not glued;<br />#  or a group with new face you can explode.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  return nil if ci</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">glued_to</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">nil</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  model </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">active_model<br />  cd </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> ci</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definition<br />  db </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> cd</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">bounds<br />  </span><span class="syntaxcomment"># get pts in counter-clockwise order;<br /></span><span class="syntaxdefault">  pt0 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> db</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">corner</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># left front bottom<br /></span><span class="syntaxdefault">  pt1 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> db</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">corner</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># right front bottom<br /></span><span class="syntaxdefault">  pt2 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> db</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">corner</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">3</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># right back bottom<br /></span><span class="syntaxdefault">  pt3 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> db</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">corner</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">2</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># left back bottom<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># get transform of ci;<br /></span><span class="syntaxdefault">  tr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> ci</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">transformation<br />  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  par </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> ci</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">parent<br />  ents </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> par</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities rescue model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br />  grp </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> ents</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">  grp</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_face</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">pt0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">pt1</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">pt2</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">pt3</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  grp</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">transform</span><span class="syntaxkeyword">!(</span><span class="syntaxdefault">tr</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">end</span>
    • RichMorinR

      Sub-component creation, decoration, etc?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      19
      0 Votes
      19 Posts
      1k Views
      thomthomT
      Yea - I miss a bug-fix list in the release notes. Gotto test this with older SU versions though.
    • RichMorinR

      Creating edges where faces intersect a plane?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      1k Views
      thomthomT
      This could be interesting: Entities.intersect_with http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/entities.html#intersect_with Also means you need a real Face to intersect your lines with. But it will correctly intersect faces that has holes in it. You'd need to create a temporarily face (inside a group I'd recommend) large enough to cover the entities you want to intersect. You could make it as large as the scene boundary. Then iterate over the faces you want to intersect, filter out those edges where the vertices lie on your intersecting face. Intersect the faces with your intersect_face.
    • RichMorinR

      Evaluate a dynamic attribute in Ruby?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      239 Views
      Chris FullmerC
      Yes. Dynamic components store their dynamic attributes in attribute dictionaries on the compopnent (or the definition mayeb). So dig through the attribute dicts to find one from the dynamic comp, and it will have all the values in there. Chris
    • RichMorinR

      Ruby methods in dynamic component attributes?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      274 Views
      RichMorinR
      Thanks! That is exactly what I was looking for! I've updated my blog entry (http://www.cfcl.com/rdm/weblog/archives/001716.html) with some speculation on how this capability might be used.
    • RichMorinR

      Using Cucumber with SketchUp

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      215 Views
      No one has replied
    • 1
    • 2
    • 3
    • 2 / 3