ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Set group parent - How to?

    7
    0 Votes
    7 Posts
    211 Views
    T
    Sorry, i was away for a few days. No, i don't have the time at the moment to post code, but i basically goes like this. I'll use Floor 0/ Wall 1/ Window/ Left Window Frame as an example. I have no idea how many volumes will be added to Left Window Frame until i have completed reading the file. This is important because entities.fill_from_mesh erases everything in the entity it is called from. So i create two "parallel" tree structures, one containing the groups (EG:Floor 0/ Wall 1/ Window/ Left Window Frame &Floor 0/ Wall 1/ Window/ Right Window Frame) and another containing the mesh, texture data for each face, other stuff and a "pointer" to the group this is supposed to go in to. When i finished reading all the data i start using it and create and fill each group.entities with the mesh, then i apply the information to the textures. The most timeconsuming in this is, by far, entities.add_group, taking up to a full 0.5 seconds when the number of groups jumps past 1500. I was hoping i could create an empty project with ~2000 empty groups, which i could just juggle around to create the exact tree stucture i need. There is no "stardard" tree structure for any of our projects, a wall might contain none or dozens of windows. I also understood that the c++ sketchup sdk is no longer supported, so we didn't take the risk to invest time in that.
  • Yet another SphereTool

    20
    0 Votes
    20 Posts
    402 Views
    thomthomT
    For UVs I won't matter. It was just odd to see a one segment Curve. I noticed it because the Smooth and Sort property was gone in the Entity Info when I selected one of them.
  • Namespace and Tool Class Question

    3
    0 Votes
    3 Posts
    328 Views
    thomthomT
    @aerilius said: Looks good so far. I haven't seen anyone using ² in a module name (but if it works, though Unicode characters like ᚠᚢᚦᚨᚱᚲ are not supported in our version of Ruby in SketchUp, otherwise my plugins would be full of them). ² also exists in the ANSI set - so I could be a simple one byte character is he used that encoding. @aerilius said: Looks good so far. I haven't seen anyone using ² in a module name (but if it works, though Unicode characters like ᚠᚢᚦᚨᚱᚲ are not supported in our version of Ruby in SketchUp, otherwise my plugins would be full of them). I copied the example from this page: http://www.oreillynet.com/ruby/blog/2007/10/fun_with_unicode_1.html <span class="syntaxdefault"><br />module&nbsp;Kernel<br />&nbsp;&nbsp;&nbsp;alias&nbsp;λ&nbsp;proc<br /><br />&nbsp;&nbsp;&nbsp;def&nbsp;∑</span><span class="syntaxkeyword">(*</span><span class="syntaxdefault">args</span><span class="syntaxkeyword">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">sum&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;args</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each</span><span class="syntaxkeyword">{&nbsp;|</span><span class="syntaxdefault">e</span><span class="syntaxkeyword">|&nbsp;</span><span class="syntaxdefault">sum&nbsp;</span><span class="syntaxkeyword">+=&nbsp;</span><span class="syntaxdefault">e&nbsp;</span><span class="syntaxkeyword">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">sum<br />&nbsp;&nbsp;&nbsp;end<br /><br />&nbsp;&nbsp;&nbsp;def&nbsp;√</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">root</span><span class="syntaxkeyword">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">Math</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">sqrt</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">root</span><span class="syntaxkeyword">)<br />&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">end<br />end<br /></span> And it worked: ` # A real lambda λ { puts ‘Hello’ }.call => ‘Hello’ Sigma - sum of all elements ∑(1,2,3) => 6 Square root √ 49 => 7.0` You can also do this: <span class="syntaxdefault"><br />module&nbsp;MyTest<br />&nbsp;&nbsp;def&nbsp;self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">ᚠᚢᚦᚨᚱᚲ<br />&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;</span><span class="syntaxstring">'world'<br />&nbsp;&nbsp;</span><span class="syntaxdefault">end<br />end<br /></span> But not this: <span class="syntaxdefault"><br />module&nbsp;ᚠᚢᚦᚨᚱᚲ<br />&nbsp;&nbsp;def&nbsp;self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">hello<br />&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;</span><span class="syntaxstring">'world'<br />&nbsp;&nbsp;</span><span class="syntaxdefault">end<br />end<br /></span> Return an error: Error: #<SyntaxError: (eval):516: compile error (eval):516: class/module name must be CONSTANT module ᚠᚢᚦᚨᚱᚲ; def self.hello; puts 'world'; end; end ^> (eval):516 That seem to be related to ᚠ not being recognised as a capital letter. Because this works: <span class="syntaxdefault"><br />module&nbsp;Xᚠᚢᚦᚨᚱᚲ</span><span class="syntaxkeyword">;&nbsp;</span><span class="syntaxdefault">end<br /></span>
  • Question about coordinate problem at zero

    5
    0 Votes
    5 Posts
    238 Views
    PixeroP
    Thanks for your replies. This isnt directly connected to SU and is from a C++ project of mine. However I solved it. Turned out I needed a custom fmod function since the one built into C really is a remainder function and not a modulo function.
  • Multiplatform editor Sublime Text 2

    23
    0 Votes
    23 Posts
    3k Views
    yorik1984Y
    I use font DejaVu Sans Mono. Zerro not look like a "O"(Dotted zerro). In Consolas font "l" look like "1"(It's bad)
  • Version of Ruby

    4
    0 Votes
    4 Posts
    173 Views
    Dan RathbunD
    @yorik1984 said: Can I use 1.8.6-p420? See: Ruby Interpreter DLLs (Win32) @yorik1984 said: And more. The latest stable version is 2.0.0. Rails(framework) used ruby 1.9.3. NO. SketchUp 8 and lower, cannot load Ruby 1.9.x and higher. Currently you must stay in the Ruby 1.8.x trunk.
  • Lost

    6
    0 Votes
    6 Posts
    220 Views
    jolranJ
    Ahh yes. Working on that type of thing too, as of speak. Tough stuff. Maybe this can be of help as well, regarding getting the face rotation in space. http://sketchucation.com/forums/viewtopic.php?f=180&t=33862&hilit=plane+on+plane I'm doing something similar to Cleverbeans solution currently to find a face edges rotation in space. However it is difficult to exactly tell what a face have for "intentional" rotation depending on several matters. Where the edges are in relation to face and so on. Scewed, tapered, N-gons and quadrilaterals faces etc that may not be perfectly square need a lot of testing if you are going to align geometry on to them. Its quite frustrating business. As soon as something gets fixed some new problem arise and need further testing. There are of course mathematical formulas to calculate all this, but honestly. If one has that kind of knowledge one shouldent be sitting and programming Sketchup plugins for free. It's damned rocket science as I see it.
  • Scenes tabs sequencing ?

    10
    0 Votes
    10 Posts
    258 Views
    Didier BurD
    @Dan, @unknownuser said: I just re-read the description for Pages.add I should have done so... Along with your "save camera" and "get_page_flags" methods, this will be easy to regenerate all my pages in the correct order (which I want to be always the same). Thanks folks,
  • Hide Cursor Help

    6
    0 Votes
    6 Posts
    560 Views
    renderizaR
    Thank you Driven & Dan Rathbun I solved it thanks to you guys! Note: loading my plugin as tool solved another problem without me trying and that is when you are playing the game before you could click & drag mouse and select objects which was bad but now its all fixed!
  • Web access for 3D model

    7
    0 Votes
    7 Posts
    182 Views
    Chris FullmerC
    Ahh, I forgot that LightUp has a web player. Your client would need to install a viewer though. But that is minimal. That would be a great option!
  • [tool] Registry Toolbar Cleaner (Windows)

    6
    0 Votes
    6 Posts
    507 Views
    thomthomT
    http://sketchucation.com/forums/viewtopic.php?f=15&t=37990&p=335586#p335586
  • Edge Center

    9
    0 Votes
    9 Posts
    2k Views
    jolranJ
    @unknownuser said: The speed difference results in that it's doing less - and all the work is done in C. While the method I had used, and your offset method, was doing more - partially in Ruby. Yeah, thats probably true. Anyway, speed increase is always good. I'll switch to this method and report back if any oddities. Cheers.
  • Count faces by material?

    3
    0 Votes
    3 Posts
    125 Views
    D
    Thanks Dan. I'd be willing to bet that save_delete_material method doesn't actually search all the faces, only those in the top-level definitions. I had thomthom help me a long time ago to write a recursive function to iterate ALL the faces, so I think I'll piece this together from that...
  • How to get the bounding box of a CAD car?

    7
    0 Votes
    7 Posts
    810 Views
    lbsswuL
    @tig said: You don't need to find those [even if you could] because the Zoom Extents on a single car does that in the view. Of course depending on your screen's current proportions and the exact view of the car you will get some 'white space' around the image. If you don't want all images to be the same size then that 'white space' is best removed with an Image editor [like Gimp] - where you can batch-open each file in turn and Auto-Crop it and save, to ensure that each car occupies as much of the image as possible... thanks for your tip! maybe I will do that in the future.
  • Help with .followme

    7
    0 Votes
    7 Posts
    177 Views
    D
    you sent me on the right track, thanks sdmitch
  • Shortest path analysis in Sketchup?

    14
    0 Votes
    14 Posts
    876 Views
    A
    I have been working on something similar and have had some success with Dijkstra's algorithm. This is my first project with SketchUp and Ruby so my plugin has been built by trial and error and isn't very pretty. The Calculate Shortest Routes command in the Plugins menu writes the results to the Ruby Console window. There is another command that writes the results to a .csv file. dijkstra.rb dijkstra_example.skp
  • Using + and - to scale regardless of tool selected

    19
    0 Votes
    19 Posts
    305 Views
    Dan RathbunD
    @thomthom said: @driven said: So my advice to the OP is please inform you users if you assign/re-assign 'shortcut' keys for them. Or rather, give them the option to decline such change. Violating this rule should be grounds for quarantine, IMHO.
  • Painting Plugin Help

    7
    0 Votes
    7 Posts
    373 Views
    renderizaR
    Christ Fullmer you are a genius!!! This transform SketchUp into the best painting application in my opinion...I will see If I can expand this & add new features to make it even better. I am so excited!...again thanks!
  • Changing the dynamic components attributes using SU API

    4
    0 Votes
    4 Posts
    659 Views
    jolranJ
    Ok, I was focusing to much on the NoMethodError. Glad you sorted it out!
  • How do i upload Plugins?

    6
    0 Votes
    6 Posts
    131 Views
    monkeybanjoM
    Thanks to all for the quick responses

Advertisement