Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Retrieving bounding-box-value from a component instance ?

    3
    0 Szavazatok
    3 Hozzászólások
    373 Megtekintések
    artmusicstudioA
    hi dan,i willk take a look at it. yes, i was searching in the forum in the mean time a lot and found a topic from 2009 whit good ideas. i can now identify the component instance and retrieve its own height, especially when it is nested. there are still some minor problems , but the ruby returns the informations needed now. thanx for helping me! stan
  • [solved] a small syntax problem

    4
    0 Szavazatok
    4 Hozzászólások
    357 Megtekintések
    jolranJ
    No problem, glad to help if the tip worked.
  • [Code] Raytest Util

    23
    0 Szavazatok
    23 Hozzászólások
    2k Megtekintések
    jiminy-billy-bobJ
    I've been playing with raytest a bit. From my understanding, it works like this: It checks ALL entities in the model root context If something is hit and it's a face/edge/etc, the raytest returns the entity If the hit entity is a group or component, it again checks ALL entities in that group/comp And so forth until it hits a face/edge/etc So if you have a lot of loose geometry in one of the hit contexts, it will be damn slow. But you can have a shitload of geometry in a group/comp not on the path of the ray, and you'll have decent performances. To check if a group/comp is hit, the raytest doesn't look at the geometry inside it, but rather at its bounding box. This is really important because you could have a lot of geometry away from the ray, but if the bounding box of the containing group is on the ray path, all of that geometry will be checked. Resulting in a slow raytest. I hope it's clear?
  • Sketchup_json gem for sketchupRuby API

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @penpendrum said: I wrote this JSON file named input.json(I saved it inside the Tools folder): { "name";"Stephen" > "age"; 22 } Each sub-object in JSON must be separated with a comma ( , ). This is resulting in the unexpected token when parsing, because it sees the 2nd "age" token object while it is trying to isolate the 1st "name" token. It should be like: { "name" ; "Stephen" , # <-- comma seapartor "age" ; 22 } @penpendrum said: and I wrote this simple ruby code in the Tools folder name testing.rb: require 'rubygems' This is not needed (but harmless,) as the Ruby loader already loads RubyGems for Ruby 2.x
  • Inputbox chedking for cancel

    6
    0 Szavazatok
    6 Hozzászólások
    626 Megtekintések
    Dan RathbunD
    Sketchup::active_model.select_tool(nil) if results == false But Jim is correct. Your boolean expression in the conditional if statement was incorrect.
  • Template loaded programmatically doesn't use style

    8
    0 Szavazatok
    8 Hozzászólások
    720 Megtekintések
    T
    @dan rathbun said: OK. Wait. I just re-read what you wrote in the OP. It seems that you believed that Sketchup.template=() would load a template (dynamically) into the currently loaded model. It should not. It only should set up subsequent calls to open a NEW model, to use the specified template. Sketchup.send_action("newDocument:") or Sketchup.file_new() To load a style dynamically, load a .style file into the styles collection, and set it active by name or index. Good catch, but I didn't believe that, actually. I was calling file_new after setting the new template, but the template style background still wasn't being used when it was outside the default templates directory for some reason.
  • About NameError: wrong constant name

    4
    0 Szavazatok
    4 Hozzászólások
    932 Megtekintések
    pingpinkP
    Thank you kindly, Trogluddite and Dan Rathbun I understand from reading your advice. Maybe, it's about class reference. These are the 3 ways I tried to do, I can't find the problem in a code yet. renderer = Kernel;;HTMLRendererP.new(result_hash['round_dimensions'].to_s == "on" ? true ; false) puts "[ToolWebUIP.add_callbacks('handle_run')] renderer; #{renderer}" Error : [ToolWebUIP.add_callbacks('handle_run')] parts: #PartListP:0xd9a0f28 Error: #<NameError: uninitialized constant Kernel::HTMLRendererP> C:/Users/Windows8/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/CurtainWall/Export/CW_Panel/gui.rb:271:in block in add_callbacks' -e:1:in call' format_string = result_hash['format'].to_s renderer = @options['round_dimensions'] == 'on' ? true ; false eval("@options['format_string']").new( renderer ) puts "[ToolWebUIP.add_callbacks('handle_run')] renderer; #{renderer}" Error : [ToolWebUIP.add_callbacks('handle_run')] parts: #PartListP:0xded0ed8 **Error: #<NoMethodError: undefined method []' for nil:NilClass>** C:/Users/Windows8/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/CurtainWall/Export/CW_Panel/gui.rb:275:in block in add_callbacks' -e:1:in `call' format_string = result_hash['format'].to_s renderer = Kernel.const_get(format_string).new(result_hash['round_dimensions'].to_s == "on" ? true ; false) puts "[ToolWebUIP.add_callbacks('handle_run')] renderer; #{renderer}" Error : [ToolWebUIP.add_callbacks('handle_run')] parts: #PartListP:0xddb8f00 Error: #<NameError: wrong constant name ["HTMLRendererP"]> C:/Users/Windows8/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/CurtainWall/Export/CW_Panel/gui.rb:270:in const_get' C:/Users/Windows8/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/CurtainWall/Export/CW_Panel/gui.rb:270:in block in add_callbacks' -e:1:in `call'
  • Identifying a group

    6
    0 Szavazatok
    6 Hozzászólások
    440 Megtekintések
    Dan RathbunD
    @artmusicstudio said: now, i think of finding a way to iterate depending of the Z height. is there a way to say directly in the iteration routine, start with lowest elements and go up to the highest? You make an array COPY of the collection, and the sort the array using the sort() method that is mixed in from the Enumerable module. Use the entity bounds() method to get a Geom::BoundingBox, and it's min() method to get a Geom::Point3d, and use it's z() method to get Length objects for the compare expression. def z_sort(coll) coll.to_a.sort {|a,b| a.bounds.min.z <=> b.bounds.min.z } end The trick is that the Comparable module must be mixed into the final object's class, on both sides of the compare <=> operator. This will always be true for Numeric and String subclasses. At the console: Length.ancestors %(darkgreen)[>> [Length, Float, JSON::Ext::Generator::GeneratorMethods::Float, Numeric, Comparable, Object, JSON::Ext::Generator::GeneratorMethods::Object, Kernel, BasicObject]] Notice that Comparable is already mixed in ?
  • Average color pasted instead of texture. Why?

    4
    0 Szavazatok
    4 Hozzászólások
    425 Megtekintések
    M
    Thanks Dan, That is exactly what I needed!
  • Notepad++ Collaboration

    18
    0 Szavazatok
    18 Hozzászólások
    3k Megtekintések
    ashscottA
    Right, Have been playing with Teamviewer lately and you could basically collaborate on SU through that - the letdown is simply refresh rate from connection speeds - hence my comment about 1Gbps. A non-technical answer
  • Ui - messagebox definition

    3
    0 Szavazatok
    3 Hozzászólások
    553 Megtekintések
    artmusicstudioA
    hi jim, thank you so much. it works. again a step closer to my ruby. stan
  • Changing the height of an edge (line)

    3
    0 Szavazatok
    3 Hozzászólások
    325 Megtekintések
    artmusicstudioA
    hi tig, thanx for your explanation. too high for me at the moment ( after several trials), but i keep on learning. i solved the problem by calculation of the bottom side at 0 directly during the creation of the elements. but one day i will also understand the vertices transormation... regards stan
  • Webdialog to ruby encoding issue on OSX

    22
    0 Szavazatok
    22 Hozzászólások
    2k Megtekintések
    D
    @tt_su said: So this only happen on OSX, not on Windows? hi TT did you get a chance to run this on your mac? and did it confirm what I state, on your setup? john
  • Newbie question: extrude following a straight line in space

    8
    0 Szavazatok
    8 Hozzászólások
    604 Megtekintések
    M
    Ah! ok, then I understand it. Thanks again!
  • Project Tango

    3
    0 Szavazatok
    3 Hozzászólások
    329 Megtekintések
    olisheaO
    maybe google are concurrently working on a 3D app too?
  • Method to Explode Groups by name beginning...

    3
    0 Szavazatok
    3 Hozzászólások
    295 Megtekintések
    S
    Looks like you focused only on group class, and corrected the wall name syntax, and I am very grateful as it now works! Thanks Tig
  • What version of Ruby should I start learning?

    20
    0 Szavazatok
    20 Hozzászólások
    2k Megtekintések
    N
    Thanks a lot!
  • Open External Links With Default Browser

    4
    0 Szavazatok
    4 Hozzászólások
    425 Megtekintések
    A
    Here is the code snippets, just so if anyone is interested later This goes to JavaScript: <span class="syntaxdefault"><br /></span><span class="syntaxcomment">// Determines whether string contains another string.<br /></span><span class="syntaxdefault">String</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">prototype</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">contains </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> function</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">it</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    return this</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">indexOf</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">it</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">!=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">-</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">;<br />};<br /><br /></span><span class="syntaxcomment">// Calls a Ruby callback.<br /></span><span class="syntaxdefault">function callback</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">name</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> data</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    if </span><span class="syntaxkeyword">(!</span><span class="syntaxdefault">data</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> data </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">''</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    window</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">location</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">href </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'skp;'</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">+</span><span class="syntaxdefault"> name </span><span class="syntaxkeyword">+</span><span class="syntaxdefault"> </span><span class="syntaxstring">'@'</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">+</span><span class="syntaxdefault"> data</span><span class="syntaxkeyword">;<br />}<br /><br /></span><span class="syntaxcomment">// Open links with default browser.<br /></span><span class="syntaxkeyword">$(</span><span class="syntaxdefault">document</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">on</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'click'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'a[href]'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> function</span><span class="syntaxkeyword">(){<br /></span><span class="syntaxdefault">    if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">this</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">href</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">contains</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"http"</span><span class="syntaxkeyword">)){<br /></span><span class="syntaxdefault">        callback</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'open_link'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> this</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">href</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">        return false</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">}<br />});<br />&nbsp;</span><span class="syntaxdefault"></span> This goes to Ruby: <span class="syntaxdefault"><br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">dlg</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_action_callback</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'open_link'</span><span class="syntaxkeyword">){</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">dlg</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> params</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">  UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">openURL</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">params</span><span class="syntaxkeyword">)<br />}<br />&nbsp;</span><span class="syntaxdefault"></span>
  • How do you intersect two faces?

    5
    0 Szavazatok
    5 Hozzászólások
    880 Megtekintések
    C
    Thanks for the replies! slbaumgartner, splendid advice. It worked much smoother than I thought it would. The code is attached below. Here are some results from intersecting the two columns in the example file: Intersect from UI: 983s Outer shell (*****): 161s g0.intersect_with g1 (******): 104s Intersect face pairs: 4s () Outer shell is probably dominated by the intersect (*) In order to produce all edges for coplanar cuts two calls to intersect_with has to be made with the groups reversed. The result above is for a single call. cuttest.zip CAUL_CutTest0.3.rb
  • Create component with different axes

    13
    0 Szavazatok
    13 Hozzászólások
    825 Megtekintések
    JQLJ
    @garry k said: JQL Flip along axis is great however, if the component has an interaction like rotate to simulate a door opening then you will find that the component reverts back to it's original state (you loose the flip). What I need to do is change axes. Funny doesn't happen to me. But I don't question your need to change axis.

Advertisement