🏢 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Note to self - Delete Thumbs.db before .zipping a plugin

    5
    0 Votes
    5 Posts
    373 Views
    J
    @dan rathbun said: And by the way... in the same list, you can eliminate the thumbs.db file if you check "Do not cache thumbnails" Yeah, but it's slow enough when I hit a folder with a lot of files in it. Caching thumbnails is speedier for me.
  • Strange warning

    3
    0 Votes
    3 Posts
    220 Views
    Dan RathbunD
    ** Please, could you change the topic title to "Warning: Float out of range" @didier bur said: def myMethod() > x=y=z=0.0 When loading the rb file, this message appears in the console: @unknownuser said: warning: Float 0.0 out of range Do you get the same warning if you do: def myMethod() x=y=z=(0.0e0) end I get no warnings at all at the Console.
  • Group#copy fails on Mac?

    6
    0 Votes
    6 Posts
    248 Views
    J
    Well, it wasn't mover2, and it's still not resolved. Will check SketchyPhysics, thanks.
  • Opening the ruby console

    3
    0 Votes
    3 Posts
    199 Views
    TIGT
    http://sketchuptips.blogspot.com/2007/08/plugin-ruby-toolbar.html Takes it a step further and also adds a toolbar button to do it for you - using the same Sketchup.send_action("showRubyPanel:") as Pixero suggested...
  • Help witn AppObserver.onQuit

    3
    0 Votes
    3 Posts
    162 Views
    honoluludesktopH
    OK, makes sense. The only other way I can think to do the above is to have a timer on one instance that checks a memory flag from time to time, but that's too much overhead.
  • Array doesn't work...

    4
    0 Votes
    4 Posts
    367 Views
    K
    Works! Thank you!
  • Help with arrays

    11
    0 Votes
    11 Posts
    238 Views
    Dan RathbunD
    @pixero said: Its actually the continuation of this thread: [url]=ttp://forums.sketchucation.com/viewtopic.php?f=180&t=33862]How to compare points on a plane?[/url] OK. So the data_array contains Geom::Point3d objects? What kind of object does the test_array contain? What is the logical condition that you want the data_array elements to be added to the new_array? If a false results from the logical test, is putting nil into the new_array OK, or do you wish some other value (perhap [0,0,0] or whatever) ? We need to be careful when comparing Geom::Point3d objects, as Google overrode the .< and .== methods (to make them dependant upon the 0.001" internal tolerance.) You should decide if that's OK for your purposes.
  • Help with componentdefinition=definitions.load name

    17
    0 Votes
    17 Posts
    825 Views
    honoluludesktopH
    Well, I completed my program, and did it by not using a path. It's my guess that SU keeps track of where SU is, so if you: Save a component to file as name.skp. Edit the saved file. (this is the function of the plugin) Erase the component instances (that was saved) from the original model entities. definitions.purge_unused componentdefinition = definitions.load name.skp entities.add_instance componentdefinition, each_transformation The key to make this work is step 4. The only problem that can come about is if you require the erased components to remain in the select "Components" window.
  • Loading a second set of points to draw lines.

    4
    0 Votes
    4 Posts
    198 Views
    Dan RathbunD
    Some links for you: Ruby Newbie's Guide to Getting Started Ruby Resources [info] Using Ruby Modules and Jim Foltz has an InputBox class wrapper that makes it easier to use the UI.inputbox method. Not sure where it's kept, but he'll see this post and let ya know.
  • How to compare points on a plane?

    17
    0 Votes
    17 Posts
    829 Views
    Dan RathbunD
    Perhaps the time to make the method call? Hmm.. but they are called only once or twice. It doesn't make sense... the 1st test is what inject does but in C code: rb_iterate(rb_each, obj, inject_i, (VALUE)&memo); and this is max, in rb_iterate(rb_each, obj, rb_block_given_p() ? max_ii ; max_i, (VALUE)&result); We should run the test several times in different orders.
  • A little suggestion.

    6
    0 Votes
    6 Posts
    304 Views
    thomthomT
    @chris fullmer said: I've written a entire RGB color picker for the SketchUp UI. I just haven't had the time/real need to implement it. Maybe I should get it into my color scripts and just release them to see how it goes. I'm not sure if my color picker is too bulky to even really be useful. But it is a great improvement over the old system. Ahh, but come to think of it, it is still necessary to enter RGB values using my color picker if you want to be prcise. So in that case, I suppose I could still revamp my RGB input methods too. Chris Aye! The color picker was looking good.
  • My Apple Keyboard VK_KEYS

    15
    0 Votes
    15 Posts
    3k Views
    Dan RathbunD
    @driven said: all the shortcut keys, SU and system just carry on working and don't register in the console at all, here at least The DELETE key registered "onKeyUp : Key code: 46 ( VK_DELETE )" in the Console (on my PC,) and deleted the selected face. It seems weird that keys would bubble up from a Tool instance keytrap callback. I can see having a bubble method that allows passing the key up to Sketchup, but to do it all the time?
  • Linetool.rb snap

    4
    0 Votes
    4 Posts
    552 Views
    thomthomT
    aiai... I meant to do a new version of that guide. ...one that made sense...
  • Something new for SU ruby one year after.???

    11
    0 Votes
    11 Posts
    558 Views
    C
    What you're describing is exactly how the QT Framework works, it's cross platform, and the Ruby bindings already exist. It also enjoys the advantage of being open-source, although the QT Designer IDE is proprietary. So just as you can write and compile C# code for the .NET framework without Visual Studio, the task is greatly simplified with the native IDE. GUI work is well outside my day to day development however, so I'm not sure if it could be made to work with the Sketchup API. I'll defer such decisions to those better qualified to make them.
  • Tube or pipe that changes sizes?

    3
    0 Votes
    3 Posts
    232 Views
    mitcorbM
    Other tools you could use: Lines to Tubes. Pipe on Path Tube on Path Fredo Scale step by step, ring by ring with orientation of scaling to orientation of rings. Curviloft, also, in a series of sections.
  • InputPoint and snapping

    13
    0 Votes
    13 Posts
    524 Views
    TIGT
    If you are trying to get a picked_point onto a 'plane' you use point.project_to_plane. If you are mimicking the 'Rotate Tool' then before you get to that step you will pick a center_point [which is by definition on that plane]. You will next set the axis/normal for the rotation [which is a vector needed to define the plane]... You define a plane as plane=[center_point, normal_vector]... So now you have everything you need to project the next picked_point onto that plane... When you take a mouse_click event the returned view inputpoint can be used to return a Point3d [ip.position] AND with a view pick_helper an entity type [or even types using several pick_helpers] - e.g. an edge or a face. If your code somehow destroys the inputpoint [?] then clone it with a 'copy' before hand and use the copy in your second bit of code... So you can click and return a point in the model and object(s) at that point. A bit of simple math will transform that point onto a predetermined 'plane' as explained above...
  • SketchUp Sunday Social (SUSS)

    3
    0 Votes
    3 Posts
    212 Views
    RichMorinR
    @khai said: open only to programmers or to all? Open to anyone, but be prepared for a programming focus to any substantive discussions. If demand warrants, I'm sure we could have events aimed at a modelers and others, but my own background and interests lie in programming.
  • [APIBug] Applying current material might cause bugsplat

    11
    0 Votes
    11 Posts
    517 Views
    TIGT
    Here's a short code snippet <span class="syntaxdefault"></span><span class="syntaxkeyword">=</span><span class="syntaxdefault">begin<br /></span><span class="syntaxkeyword">(</span><span class="syntaxdefault">c</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> TIG 2011<br /></span><span class="syntaxkeyword">=</span><span class="syntaxdefault">end<br />require </span><span class="syntaxstring">'sketchup.rb'<br /></span><span class="syntaxdefault">require </span><span class="syntaxstring">'SKMtools/material_class.rb'<br /></span><span class="syntaxcomment">###<br /></span><span class="syntaxdefault">def material_from_limbo</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">    mats </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">materials<br />    cmat </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> mats</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">current </span><span class="syntaxcomment">### the limbo one<br /></span><span class="syntaxdefault">    cname </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> cmat</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">display_name<br />    cmat</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">name </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> cname</span><span class="syntaxkeyword">+</span><span class="syntaxstring">"x"<br /></span><span class="syntaxdefault">    cmat </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> mats</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">current<br />    cmat</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">name </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> cname<br />    cmat </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> mats</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">current<br />    return cmat </span><span class="syntaxcomment">### now safely added to model<br /></span><span class="syntaxdefault">end<br /></span><span class="syntaxcomment">### usage; cmat = material_from_limbo<br /></span><span class="syntaxdefault"> </span> If you select a material from the library and then immediately run the 'usage' example you will have a reference to the new current material that is added to the model [but currently unused]. The active tool will stay as the paintbucket unless you code an alternative 'tool' change...
  • Definition.instances upset

    3
    0 Votes
    3 Posts
    223 Views
    chrisglasierC
    Takk! Now you have said it I feel somewhat foolish ... oh well ... time to go to the pub. Maybe next year I can do better. Happy New Year to you and all the other members. Chris
  • Inpupoint pick problem

    2
    0 Votes
    2 Posts
    196 Views
    thomthomT
    Initialize your variable in the correct scope. <span class="syntaxdefault"><br />class My_Tool<br />   def initialize<br />     </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">ip1 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">InputPoint</span><span class="syntaxkeyword">.new<br /></span><span class="syntaxdefault">     </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">ip2 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">InputPoint</span><span class="syntaxkeyword">.new<br /></span><span class="syntaxdefault">     </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">point_flag </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 1<br />   end<br /><br />   def activate<br />      puts </span><span class="syntaxstring">"Activate"<br /></span><span class="syntaxdefault">   end<br /></span> Explanation: http://sporkmonger.com/2007/2/19/instance-variables-class-variables-and-inheritance-in-ruby http://railstips.org/blog/archives/2006/11/18/class-and-instance-variables-in-ruby/

Advertisement