sketchucation logo sketchucation
    • Login
    1. Home
    2. sm4rt
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 17
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Google is Listening!

      I agree too but instead of creating some topics here, contact em each times I got new suggestion or waiting for a real wide 3weeks survey (lol) I prefer post here (as a wailing wall)

      Also need a dialog box on new doc creation which propose us a template like all other soft do in fact... (quite bored to change it in preferences window before launching new document)
      untitled-1.jpg

      posted in SketchUp Discussions
      S
      sm4rt
    • RE: Google is Listening!

      @thomthom said:

      @sm4rt said:

      I don't know if this was already mentioned but we really need the orthogonal type in sketchup like AutoCAD do in order to simplify the building of object with Sketchup.

      "orthogonal type" ?

      I was speaking about this
      AutoCAD.jpg

      posted in SketchUp Discussions
      S
      sm4rt
    • RE: Sketchup Make Penrose Triangle in 3D

      arf ! understand till the water fall on the watermill...

      posted in Gallery
      S
      sm4rt
    • RE: Sketchup Make Penrose Triangle in 3D

      @Pilou sorry missed the search function I think... Continuing the discuss there... And I've already found some penrose triangle/step like yours in warehouse but all are about unclosed figures. My goal was to create a closed one...

      @Aerilius nobody but everybody know that with all 90Β° angles a penrose tirangle is impossible so that's what it should looks like when you look around one in 3D... imo

      I've spent some time on it 😐

      posted in Gallery
      S
      sm4rt
    • RE: Optimization Tips

      Was talking about shifting binary number is longer then the same "base 10" arithmetic operation...

      Which is no sense in processor calculation.
      Try the same comparison in ASM, C++, PHP etc. and look the result^^

      But in this case I think it's because x = 0b0011_1100<<2 affect the decimal number of the binary one to x variable so the number of edge clock needed is greater... IMO

      Edit: And for loop isn't for me Result-for-each-variables.txt
      here is my results of the test that ThomThom put above to prove that for loop is better then each one and that declaring variable before is faster too but it's still not true for my equipment...
      (Ruby 1.9.2-p180 / Windows 7 64 bit / Intel Core i3 M 350 2.27GHz)

      So I think that these optimizations depend of many variables....(versions of Ruby/Sketchup) Even if some will still be true in the future...

      posted in Developers' Forum
      S
      sm4rt
    • Sketchup Make Penrose Triangle in 3D

      Hi,

      was really interested about the fact that Penrose Triangle was not available to become real in 3D space !

      I've founded some 3D models in 3D Ware House but they are all about "illusion?" (I mean not connected model)....

      So ! here is what Penrose Triangle is in 3D space.... 😍

      Penrose_Triangle.png
      Download link
      (look front/back view and around^^)

      I think it could be better then that but I'm quite satisfies of this result

      fill free posting some other optical illusions built in SU πŸ˜‰

      posted in Gallery
      S
      sm4rt
    • RE: Optimization Tips

      Well I got a situation !! 😲

      C:\>ruby test.rb range = (0..90000000) t=Time.now; x=0; i=0; range.each { |i| x = 0b0011_1100<<2 }; Time.now-t 13.156753 t=Time.now; x=0; i=0; range.each { |i| x = 60*4 }; Time.now-t 10.400594

      just a no sens !!!
      Really a human oriented language πŸ˜‰

      posted in Developers' Forum
      S
      sm4rt
    • RE: [Plugin] Component Libraries Loader

      damn! still impressive TIG!

      I've just modified it to treat folders before skps and added the ability to load more then one folder...

      File in attachment for those who want

      here is the log^^

      @unknownuser said:

      Copyright 2011 by sm4rt (No it's TIG one in fact)

      THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR

      IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED

      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

      Name : Dynamic Component Loader 0.1.1rc1

      Description : load full libraries of components you often use by creating a menu list of your component libraries

      inside the Sketchup Plugins Menu

      Author : sm4rt but TIG

      Usage : Simply edit/add the name you want to give for your component libraries inside "librariesNames" declaration

      edit/add the corresponding folder path inside "librariesFolders" declaration

      And that's it !

      you'll no longer have to search through your disk to find model you usually use

      Just feed your model libs as time goes by

      Script will load sub-folders too

      Date : 8.Apr.2011

      Type : Loader

      History:

      0.1.1rc1 (8.Apr.2011) - impressive fully versatile revision

      0.1.1beta1 (7.Apr.2011) - loud dirty unefficient version


      Component Libraries Loader Plugin

      posted in Plugins
      S
      sm4rt
    • RE: [Plugin] Component Libraries Loader

      No I was speaking about my version of the first post.... Because there is non sens there^^

      Actually the last one I send works good for me... thanks to you^^ (and your last suggestion don't or is a good solution for declaring Absolute path personally I prefers Relative declaration like you did...

      But I've suppressed "submenus=[]" though...

      posted in Plugins
      S
      sm4rt
    • RE: [Plugin] Component Libraries Loader

      Any ideas of what happens and what's wrong in my version because I really don't understand where is the mistake in fact...

      trying to treat files before folders but it don't change anything :

      • when there is a sub folder everything works good
      • when the actual folder is the last child one, skps do not load <= path is wrong |
        but path is good before entering in the load function / wrong inside it / and right after quiting the load function....

      it make me crazy! 😑

      posted in Plugins
      S
      sm4rt
    • [Plugin] Component Libraries Loader

      Hi all!

      I'm currently writing a little Ruby Script which dynamically load all components (uh actually all files 😐 ) containing inside a specific folder. (including sub-folders)

      The problem is that it need an empty sub-folder when some skp are present to be able to launch them... And I really don't know why ?

      (file in attachment, I know that it's quite dirty but it's a simple test for the moment)

      the problem appears on line 47

      	  #UI.messagebox foldername
      	  $menu[folderNumber].add_item(fichier){component_loader(fichier,foldername)}
      	  #UI.messagebox foldername
      

      If I active messagebox to view foldername before and after the calling to the function component_loader() the name is good.
      But inside the component_loader function, foldername refer to the parent directory if and only if there is no sub-directory inside the current folder....

      I really don't understand why even if I suspect the line 42 to be guilty nevertheless I don't understand why before and after the calling of the function the name of the folder is good...

      foldername[fichier+"/"]=""
      

      (here to change the directory name the parent one when the reading of the actual is over)

      Any ideas ?


      MyLoader.zip

      posted in Plugins
      S
      sm4rt
    • RE: Google is Listening!

      Hi Google !

      I don't know if this was already mentioned but we really need the orthogonal type in sketchup like AutoCAD do in order to simplify the building of object with Sketchup.

      And I also really need a bezier curves tool develloped by sketchup. In fact I've found a plugin that help me to build some special curves but this tool isn't truelly efficient.

      Hope this will come asap πŸ˜‰

      posted in SketchUp Discussions
      S
      sm4rt
    • RE: Load an object and attached it to the pointer

      And it work ! 😍

      Thank y'all for your help...

      posted in Developers' Forum
      S
      sm4rt
    • RE: Load an object and attached it to the pointer

      Thanks for answering.

      So I trayed that :

      # First we pull in the standard API hooks.
      require 'sketchup'
      # Add a menu item to launch that one.
      UI.menu("PlugIns").add_item("My Models") {
       # Ruby Console after click
       Sketchup.send_action "showRubyPanel;"  
       # Method calling.
        load_MyModels
      }
      def load_MyModels
       model = Sketchup.active_model
       show_summary = true
       status = model.import "Components/MyComponent.skp", show_summary	
      end
      

      But Sketchup return me that it could not find the file I've placed in the component folder ?

      posted in Developers' Forum
      S
      sm4rt
    • Load an object and attached it to the pointer

      Hi all,

      I got a new problem using ruby in sketchup...

      I tray to create a dialog box which let user to load some objects inside the "component folder". I've successfully made it but I would like to attached the object loaded to the pointer in order to place it with the mouse like sketchup do when we drag and drop some SKP from desktop to the working window...

      here is a simple example :

      
      # First we pull in the standard API hooks.
      require 'sketchup'
      # Add a menu item to launch that one.
      UI.menu("PlugIns").add_item("Load Tree") {
       # Method calling.
        load_Tree
      }
      def load_Tree
       # Prompt parameters dialogue
       prompts = ["X in cm","Y in cm","Z in cm"]
       defaults = ["0","0","0"]
       list = ["","",""]
       input = UI.inputbox prompts, defaults, list, "Origine Point"
      pannelType = "MyTree.skp"
      model = Sketchup.active_model
      entities = model.active_entities
      path = Sketchup.find_support_file pannelType ,"Components/"
      definitions = model.definitions
      componentdefinition = definitions.load path
        x0= input[0].to_i / 2.54
        y0= input[1].to_i / 2.54
        z0= input[2].to_i / 2.54
      point = Geom;;Point3d.new x0,y0,z0
      transform = Geom;;Transformation.new point
      instance = entities.add_instance componentdefinition, transform
       if (instance)
          UI.messagebox "Tree successfully loaded"
       else
          UI.messagebox "Failure"
       end
      end
      
      

      My goal is to delete the "x,y,z" arguments in the dialog box and place the object with mouse but I can't find anything inside the Google API and I turn in a round reading it...
      I think it's possible and quite easy to do that...

      Thanks for your suggestions

      posted in Developers' Forum
      S
      sm4rt
    • RE: [help]Group component instances

      oh nice! thank you for it and for your note... (really need to study ruby first I think)

      I've just to transform it now with two rotations but only the last one work in fact. if you got a lil tip for it... I'll calculate the resulting vector and angle of the two transform I need that's pretty strange...

      posted in Developers' Forum
      S
      sm4rt
    • [help]Group component instances

      Hi,

      I'm beginner in SketchUp Ruby coding and in fact I've never code into Ruby... (only C++ PHP JavaScript skills)

      Well I load and place some components using a "for" loop

        for i in 1..numberP
          point = Geom;;Point3d.new x0,y0,z0
          transform = Geom;;Transformation.new point
          model = Sketchup.active_model
          entities = model.active_entities
          path = Sketchup.find_support_file "mymodel.skp" ,"Components/"
          definitions = model.definitions
          componentdefinition = definitions.load path
          instance = entities.add_instance componentdefinition, transform
          # Calculate next panel corner for next loop.
          numinraw = num % numbyraw
          if (numinraw==0)
            x0 = abscisseRaw * rawNum
            y0 = ordonneeRaw * rawNum
            rawNum += 1
          else
            x0 = x0 + abscisse
            y0 = y0 + ordonnee
          end
          num += 1
      end
      
      

      And after that I want to group theses componentdefinition in order to apply them some other transformation...

      I imagine placing a line like "group = model.active_entities.add_group" just after the instance declaration or selecting all instances after the loop...

      But it does not work certainly due to the group declaration and the way I want to add components inside after

      posted in Developers' Forum
      S
      sm4rt
    • 1 / 1