sketchucation logo sketchucation
    • Login
    1. Home
    2. tt_su
    3. Posts
    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.8b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1,034
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Misbehavior when work axes have been moved/rotated

      NOTE! THIS IS A DIRTY HACK!

      Avoid if possible.

      DO NOT use in the middle of another operation or observer event!

      It creates a couple of temp groups and extract the axes information from that. This works because since SU7 groups orient themselves by the working axes.

      If you absolutely need to use this within another operation then remove the start/abort_operation and manually remove the temp group.

      Note that you only get the orientation of the axes - not the position because for some reason the transformation return bogus values for the origin.

      <span class="syntaxdefault"><br />    </span><span class="syntaxcomment"># SU7+ only - incorrect in older versions.<br /></span><span class="syntaxdefault">    </span><span class="syntaxcomment"># A hack to get the current model axis.<br /></span><span class="syntaxdefault">    </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">    </span><span class="syntaxcomment"># @return [Array<Vector3d,Vector3d,Vector3d>]<br /></span><span class="syntaxdefault">    </span><span class="syntaxcomment"># @since 1.1.0<br /></span><span class="syntaxdefault">    def get_local_transformation<br />      </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">start_operation</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Get Local Transformation (Hack)'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      entities </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br />      tr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">transformation<br />      </span><span class="syntaxcomment"># (?) SketchUp bug?<br /></span><span class="syntaxdefault">      </span><span class="syntaxcomment">#     The transformation returned has X, Y and Z set to 1.0e+030!<br /></span><span class="syntaxdefault">      </span><span class="syntaxcomment">#     Why this high value? Overflow bug?<br /></span><span class="syntaxdefault">      Geom</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Transformation</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">xaxis</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">yaxis</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">zaxis</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> ORIGIN </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    ensure<br />      </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">abort_operation<br />    end<br /></span>
      
      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Misbehavior when work axes have been moved/rotated

      The API currently lacks support for getting the current working axes.
      I've used a hacky workaround in the past involving creating temp groups to extract the info - I need to dig around to find where I'd used that.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: [PLUGIN] Flowify v1.1.0 (updated 150327)

      Loving the haunted house example! 😄
      It's been a while since I used Rhino - is the operation of setting up the meshes the same as FlowAlongSrf?

      (Btw, nice example of Bezier Surface there - it's seem to be more versatile than I expected. 😄 )

      posted in Plugins
      tt_suT
      tt_su
    • RE: [Plugin] SketchUcation Tools 2.6.1

      @tig said:

      Is this array.clone versus array.dup ?
      I have side-stepped that process now anyway, by making a new array and adding items to that...

      Are you cloning the items you add?

      posted in Plugins
      tt_suT
      tt_su
    • RE: [Plugin] SketchUcation Tools 2.6.1

      This article expand on the whole pass-reference-by-value nature of Ruby:
      http://robertheaton.com/2014/07/22/is-ruby-pass-by-reference-or-pass-by-value/

      posted in Plugins
      tt_suT
      tt_su
    • RE: [Plugin] SketchUcation Tools 2.6.1

      @tig said:

      It works on a clone of $:, so can I assume that the locked string still passes through that !

      How do you clone?

      If you do call .clone then you clone the Array object itself - but it's a shallow clone. It doesn't clone all it's internal data.

      <span class="syntaxdefault"><br />x&nbsp;</span><span class="syntaxkeyword">=&nbsp;[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br />[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br /><br /></span><span class="syntaxdefault">y&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">x</span><span class="syntaxkeyword">.clone<br />[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br /><br /></span><span class="syntaxdefault">x</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id<br />88135980<br /><br />y</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id<br />90415700<br /><br />x</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each&nbsp;</span><span class="syntaxkeyword">{&nbsp;|</span><span class="syntaxdefault">n</span><span class="syntaxkeyword">|&nbsp;</span><span class="syntaxdefault">puts&nbsp;n</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id&nbsp;</span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">88136040<br />88136000<br /></span><span class="syntaxkeyword">[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br /><br /></span><span class="syntaxdefault">y</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each&nbsp;</span><span class="syntaxkeyword">{&nbsp;|</span><span class="syntaxdefault">n</span><span class="syntaxkeyword">|&nbsp;</span><span class="syntaxdefault">puts&nbsp;n</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">object_id&nbsp;</span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">88136040<br />88136000<br /></span><span class="syntaxkeyword">[</span><span class="syntaxstring">"hello"</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">"world"</span><span class="syntaxkeyword">]<br />&nbsp;</span><span class="syntaxdefault"></span>
      
      posted in Plugins
      tt_suT
      tt_su
    • RE: Entity.transform!

      By the way, if you transform multiple entities it's faster to do it in bulk with Entities.transform_entities or Entities.transform_by_vector. Ditto for erasing and selecting - the performance differences between doing this in bulk is significant.
      Whenever you use erase! or transform! etc or any other single entity action within a loop consider the bulk alternatives.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Entity.transform!

      @al hart said:

      I have some code which used to use entity.transform!(transformation)
      But this no longer works for faces or edges in SU 2014 and SU 2015.
      But, this must have worked once. Did this change in SU 2014?

      No - Entity.transform! has never been part of the API. If you ever used this you where using some custom method someone modified the API namespace with.

      We've not removed methods from the API and the API docs is the one you should go by in terms of looking up what is part of the API. Anything else is stuff that has been injected. There are the occational debug helper methods that we hooked up, but they are not supported as part of the API.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: [Plugin] Compo Spray 1.4.2 Updated

      @aceshigh said:

      but weren´t all plugins installed to Program Files in Sketchup 7 and 8?

      Yes, however that came from a time before Microsoft had these restrictions. Additionally, Ruby 1.8 was unable to deal with unicode at all - and some users have unicode characters in their names that would break. What complicated things more was that XP has localized system folder so the least pain, most compatible folder used to be Program Files. That has changed now, with Ruby 2.0 and newer versions of Windows - so extensions should be installed to the default Plugins folder or the AllUsers profile. Anything else is not supported and is very likely to cause other problems.

      posted in Plugins
      tt_suT
      tt_su
    • RE: [Plugin] Compo Spray 1.4.2 Updated

      @aceshigh said:

      @nghminh81 said:

      Thanks so much Oxer and MTriple. Your file works perfectly with my sketchup 2014!

      To anyone who using Windows and still can't install it: Please extract files(ComposprayToolbar.rb and 1 folder Compospray) to "C:\Program Files (x86)\SketchUp\SketchUp 2014\Tools".

      DON'T EXTRACT FILES TO "C:\Users\XX\AppData\Roaming\SketchUp\SketchUp 2014\SketchUp\Plugins"
      AND IF THEY WERE THERE (Because you tried to install it) Just DELETE.

      following your method, it is now working with Sketchup 2015.

      I don´t even know why I try installing by using the rbz file from inside Sketchup. With Sketchup 7 and 8 I installed 99% of the extensions by unzipping into the plugins folder.

      I would strongly recommend to NOT follow that advice. Windows tries to enforce a strict lock down to Program Files. On many systems extensions will not be able to write to that location - which often they want to.
      I suspect that some of the issue in this case is due to non-English characters in the username. This should in theory be fixed in Ruby 2.0 - but there appear to be some bugs in the Windows version of Ruby. It should however be possible for the developers to work around this. Hard to tell exactly in this case without knowing the source.

      To work around this until the developer have a chance to update the extension you can try to install to the AllUser profile:

      C:\ProgramData\SketchUp\SketchUp 2015\SketchUp

      AFIK that should not have unicode characters. Create a Plugins folder and extract the RBZ content there. (Rename RBZ to ZIP and extract like you did in SU6-SU8).

      User should really not be modifying files in Program Files. Windows will fight back.

      posted in Plugins
      tt_suT
      tt_su
    • RE: Profile Builder 2

      @agrazdi said:

      Sometimes when applying a change of the profile size, a BUG SPLAT is produced.
      Have you noticed ??

      Did you submit the BugSplats? If you didn't, can you please do? And did you enter any info in the description or name that I can use to look it up?

      posted in Plugins
      tt_suT
      tt_su
    • RE: Adding attributes help

      Yea, like you wouldn't feed raw user data to your database, you don't want to feed user data to eval. (I consider anything read in from the system or file to be "user data"). Validate and sanitize - this is the stuff you want to find a library that has solved all the edge cases for you.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Adding attributes help

      @eneroth3 said:

      I really wouldn't save a ruby string as an attribute and later eval it. It opens up for code injection and lets people run whatever malicious code they want on someone else's computer just by sending them a model made to take advantage of this vulnerability and wait for the moment where eval is called.

      +1 eval = evil

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: [REQUEST] Simple bone structure

      Ohh... this is an interesting thread!

      posted in Plugins
      tt_suT
      tt_su
    • RE: Testing Ruby VALUES in C-extension.

      @jiminy-billy-bob said:

      @tt_su said:

      @jiminy-billy-bob said:

      I just came accross an issue you guys should know about (if you don't already) : We can't pass more than 15 arguments in a single function from ruby to C++.

      You actually hit that limit? 😲

      Well... 😕 I try to limit the back-and-forth between ruby and C++, so I pass all the information in one go, and treat everything in C++.

      A Hash would be good to pass instead - much easier to manage whenever you change some of the data you pass. No need to worry about changing argument order etc.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Testing Ruby VALUES in C-extension.

      @garry k said:

      It looks like I'll have to use the visual studio compiler for c extensions in sketchup.
      There is an MS specific config file and no other counterparts for borland etc.

      ThirdParty\include\ruby\2.0\win32\i386-mswin32_100\ruby\config.h

      For the examples we provided projects only for Visual Studio on Windows and Xcode on OSX. If you want to compile with another compiler you are free to do so - but we don't provide examples for all compilers.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Testing Ruby VALUES in C-extension.

      @jiminy-billy-bob said:

      I just came accross an issue you guys should know about (if you don't already) : We can't pass more than 15 arguments in a single function from ruby to C++.

      You actually hit that limit? 😲

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Testing Ruby VALUES in C-extension.

      It explains the important parts better than the Ruby C API readme:
      https://github.com/ruby/ruby/blob/trunk/README.EXT

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: Testing Ruby VALUES in C-extension.

      Came across this article today: http://silverhammermba.github.io/emberb/c/#exceptions

      Nice little overview over the Ruby C API.

      posted in Developers' Forum
      tt_suT
      tt_su
    • RE: [Plugin Library] LibFredo6 - v15.8b - 12 Jan 26

      @emn said:

      Sketchup crashes when I use Roundcorner. (I just installed roundcorner)
      Using sketch up pro 2015 on Mac OS 10.9.5. Extentions installed: Mirror_v4.2, Libfredo v6.6b, Roundcorner V2.6a and jbb_layers_panel_16.

      Roundcorner IS working. I'm able to round of corners. When the corners are rounded and I pan my view, (using the middel mouse button) Sketchup crashes.

      Anyone?

      Did you submit the BugSplats?
      If you did - did you enter any details in the report? Description, name or email I can use to look up the crash?

      posted in Plugins
      tt_suT
      tt_su
    • 1
    • 2
    • 3
    • 4
    • 5
    • 51
    • 52
    • 3 / 52