⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Profile Builder API?

    6
    0 Votes
    6 Posts
    1k Views
    TommyKT
    Whaat, It would be amazing to have an API. Could you also perhaps include a callback system when a profile member or assembly is created/edited, so that other plugins could do their magic? On the information side of things, it could be things like updating a "price" attribute, which is based on the volume of the profile output, for instance. For such a callback, the useful variables would be: the geometry representing the path of a PM the group for the outputted member the face of the profile / components that make up the assembly.
  • Hidden Face Removal

    2
    0 Votes
    2 Posts
    510 Views
    bomastudioB
    [image: QIru_2DVectorVIEW.png] I'm on the road, I can draw the view and project exactly what I can see on the XY plane. But the problem is how to implement one the "hidden face removal" algorithms.....like the "painter algorithm", or the "Z-buffer" and so on.... In the MAKE version of SU I can't use the boolean operators so I'm in stall.....any ideas? EDIT: In this procedure I'm using the back-face culling algorithm in order to improve performaces.
  • [New scripter] Will need help on my project (now and then)

    21
    0 Votes
    21 Posts
    2k Views
    Dan RathbunD
    @ruts said: In my calculations ... I want to use the base ruby class Matrix which is made for such operations. I found out that it's not just adding require 'matrix' to your code. Because SketchUp was not distributed with the Ruby Standard Library until version 2014. @ruts said: I did copy the matrix.rb and e2mmap.rb (which is required by matrix.rb) from the ruby2.2.2 folder ... This will not work, as you need to use the library compiled and distributed with the Ruby version that SketchUp uses. The constants RUBY_VERSION and RUBY_PATCHLEVEL typed at the console tell you what SketchUp embedded Ruby is. @ruts said: ... I believe this is the right way to require 'matrix'. Nope (when the standard library is properly installed,) just a simple require 'matrix' will do (because it will load it's own dependencies as it is evaluated.) @ruts said: I think I already have a solution for my problem. NO you don't, because you "don't have time to read the book," all this basic Ruby 101 knowledge is escaping you. So just go to my GitHub repo and get the Standard Ruby 1.8.6-p287 Library packaged for SketchUp 2013 and earlier on Windows ONLY. https://github.com/DanRathbun/sketchup-ruby186-stdlib-extension/releases/tag/2 With SketchUp closed: (1) Put the RBZ archive someplace where you can navigate easily to it. (2) Delete any manually copied library files (such as those you mentioned copying above.) (3) Then start SketchUp 8 and use the manual "Install Extension ..." button from Window > Preferences > Extensions (3a) Navigate to where you saved the RBZ archive, and select it, click OK. (4) Open the console and test that the paths are correctly set in $LOAD_PATH (aka $:) by typing: puts $: and ENTER You should see a listing similar to: puts $:%(green)[C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins C:/Program Files (x86)/SketchUp/SketchUp 8/Tools C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/1.8 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/1.8/i386-mswin32 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/site_ruby/1.8 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/site_ruby/1.8/i386-msvcrt]nil The actual program files path might also look like: %(green)[C:/Program Files (x86)/Google/Google SketchUp 8/...] (5) Then further test the loading of "matrix.rb" via: require "matrix" You should see true returned.
  • Plugin load residue, ruby

    5
    0 Votes
    5 Posts
    776 Views
    M
    Thanks for the information, the problem is solved. A hidden bakup copy of the .tb file had been created in the Plugin folder. Sketchup kept trying to open that file. After making all the files visible in windows, and deleting the file, the problem was solved. With kindest regards.
  • Surface area of a component/group made up of groups

    2
    0 Votes
    2 Posts
    573 Views
    JQLJ
    Fredo has a plugin for area labelling under his Fredo tools. It works rather well and probably the functionallity can be adapted to your needs. Sketchup also has the ability to report material areas, so if your outer shell is all made from certain materials you can add up your areas.
  • Raise left click

    4
    0 Votes
    4 Posts
    575 Views
    bomastudioB
    It's a new feature of SU2015 BTW?
  • Simple question: Click to create a point

    3
    0 Votes
    3 Posts
    636 Views
    B
    Thanks alot! I will give it a try.
  • Width, height and center of face?

    2
    0 Votes
    2 Posts
    554 Views
    TIGT
    In the old days there were two conventions for describing XYZ in 3d CAD. Oddly the bounding-box uses the older convention, which is not used elsewhere within SketchUp. SketchUp uses the more obvious convention, that is, as if you were looking at the 3d object in the real world 'through' the screen as if it were a 'window-frame' - X=left-right/red, Y=in-out/green and Z=up-down/blue. The other 3d CAD convention grew from 2d - it assumed you drew 'on the screen' as if looking down in plan - so bounds.width [~screen-width] is equivalent to SketchUp's X-red, and bounds.height [~screen-height] is equivalent to SketchUp's Y-green; the remaining bounds.depth is SketchUp's Z-blue - originally assumed to project in/out of the plane of the screen - to add the 3d element to a 2d plan ! A '2d' face's bounds has no 'depth' - only width and height [and center] etc Make a note of these odd naming conventions and use them accordingly.
  • Layer Transparency ?

    3
    0 Votes
    3 Posts
    518 Views
    WhyDiW
    thanks for the reply but bad news! anyone knows any make up for that, even hard? i easily deal with ruby have a good day
  • How to see the results of this method?

    8
    0 Votes
    8 Posts
    857 Views
    TIGT
    @Jim Thanks, I knew there was something somewhere - but it was six and a half years ago ! To précis a version of AdamB's [much cleverer] code: def self.face_area(mat, context, tr) area = 0.0 context.entities.grep(Sketchup;;Group).each{|e| area += self.face_area(mat, e, e.transformation) } context.entities.grep(Sketchup;;Component_Instance).each{|i| area += self.face_area(mat, i.definition, i.transformation) } context.entities.grep(Sketchup;;Face).select{|f| f.material == mat }.each{|f| normal = f.normal binormal = Geom;;Vector3d.new(normal.y, normal.z, normal.x) tangent = (normal * binormal).normalize areascale = (tr * binormal).length * (tr * tangent).length area += ( f.area * areascale ) } return area end The 'mat' must be a reference to a model.material [or nil]... The 'context' must be either the model or a group or a definition [i.e. something that will have 'entities'] The transformation 'tr' must be a 'Geom::Transformation' - even it's 'blank', so the arguments are: (material, model, Geom::Transformation.new()) (material, group, group.transformation) (material, instance.definition, instance.transformation) The method returns the area of all faces within the context, included nested containers, and adjusts them to allow for any scaling of those containers... To apply transformations of nested containers which themselves are within transformed containers etc, you need to iterate the method within itself, passing/reapplying transformations [similar to the earlier example 'sum_area' method] which I have botched in here... Note how its 'self.' assumes it's called as a method within a module.
  • Component edit window...

    2
    0 Votes
    2 Posts
    515 Views
    JQLJ
    These should be adapted to, instead of openning a temp file, open the "save as" file if one exists. Otherwise it's a fine idea.
  • Solved: how to get the ruby version?

    2
    0 Votes
    2 Posts
    789 Views
    A
    Found it... it's the RUBY_VERSION const! cheers
  • How do I change the code?

    3
    0 Votes
    3 Posts
    589 Views
    C
    TO TIG: Thank you for your reply! If I want to get the component's dynamic attributes(lenx, leny...) by multiple components collision detection? and I will deduction of the overlapping area(multiple components) after... (1)multiple components collision detection (2)get the component's dynamic attributes(lenx, leny...) Thank you for your help!
  • Using wxWidgets in extensions

    4
    0 Votes
    4 Posts
    817 Views
    T
    The most important thing is to hide all symbols when compiling wxWidgets on Mac. When fluid has done it, the crash is gone. We have same issue as with V-ray now. Thea dialogues will not close and neither refresh. It is most likely caused by using IMPLEMENT_APP_NO_MAIN(MyApp) macro in AO. This allows just a single instance of wxApp. Our solution is to create our own instance of wxApp and to use wxApp::SetIntance( instance ); instead. When SU closes I do a clean-up and call wxUninitialize(); As far as I know Thea doesn't affect any plugin, so the solution works correctly.
  • Qt4 GUI in Ruby for Sketchup plugin's

    17
    0 Votes
    17 Posts
    3k Views
    A
    I also want to use QT for user interface. Is there any examples? I decide to create thread and execute main loop of QT application in this thread. [pre:g779cno0]DWORD WINAPI mainLoop(CONST LPVOID lpParam) { coreDataStruct * data = (coreDataStruct *)lpParam; int argc = 0; char **argv = 0; data->app = new QApplication(argc, argv); data->app->setQuitOnLastWindowClosed(false); data->app->exec(); data->active = 0; ExitThread(0); } VALUE cModule_initialize(...) { if (coreData->active == 0) { HANDLE thread = CreateThread(NULL, 0, &mainLoop, (void*)coreData, 0, NULL); coreData->mainThread = thread; coreData->active = 1; return Qtrue; } return Qfalse; }[/pre:g779cno0] Thread is created in function cModule_initialize that should be executed in the begining To create window I have this function: [pre:g779cno0]VALUE cModule_createWin(...) { if (coreData->active == 0) return Qfalse; QDialog *dialog = new QDialog; dialog->show(); return Qtrue; }[/pre:g779cno0] Is that correct?
  • Flags for onMouseMove

    13
    0 Votes
    13 Posts
    2k Views
    fredo6F
    @driven said: write a test with some puts and I'll test it... john Thanks in advance. I thought initially that the question was resolved somewhere in the forum, but could not find it (and it is anyway not described in the SU API doc). Fredo
  • Start_operation and commit_operation issue

    5
    0 Votes
    5 Posts
    646 Views
    G
    Sorry, Start and commit are not nested. A few lines of debug code proves that. Still at a loss.
  • How to reload a skp as componet

    3
    0 Votes
    3 Posts
    665 Views
    W
    @jim said: Hi wikii - this topic may be of interest: http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=60568 Thank you for your suggestion, Jim.
  • Detect whether all elements of the model intersect

    10
    0 Votes
    10 Posts
    852 Views
    C
    Hello everyone I reference everyone's suggestion The successful implementation of the following code: mod = Sketchup.active_model ent = mod.entities grp = ent.grep(Sketchup::ComponentInstance) for i in 0...grp.length - 1 grp.each{ |g| next if g == grp[i] bb = Geom::BoundingBox.new.add(g.bounds.intersect(grp[i].bounds)) if bb.valid? puts "#{g.name.to_s} and #{grp[i].name.to_s} intersect" else puts "#{g.name.to_s} and #{grp[i].name.to_s} do not intersect" end bb.clear } end Next, I want to know how to calculate the model of dynamic properties of all objects (such as "Lenx", "Leny" ,"Lenz"...etc) after the object intersected the other object. The case description like this: First, detect all objects intersect situations like the above code Second, if name = "column" objects intersect name = "beam" objects(just a simple example) then, "column" objects dynamic properties("Lenx") deduction "beam" objects dynamic properties("Leny") Thank you for your advice and help [image: NS2n_01.JPG] [image: ZMDk_02.JPG]
  • How to make toolbar in method(def..end) has parameters

    9
    0 Votes
    9 Posts
    2k Views
    C
    Thanks for everybody help and advice The problem has been resolved

Advertisement