sketchucation logo sketchucation
    • Login
    1. Home
    2. TNTDAVID
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 99
    • Posts 736
    • Groups 2

    Posts

    Recent Best Controversial
    • Delete a list of components by their definitions.

      **Hello, ☀

      I want to delete a list of components with their definitions and then purge their textures.

      Description of the step-by-step method:

      1 - All components that are named ['BOXE', 'CUBE'] in their definitions are deleted and purged without affecting the unused components.

      2 - All textures used by the components in the list must be purged without affecting the other materials.

      Note

      The goal is to find an alternative to purge_unused.

      The method must remove the components even if they are used in SketchUp and nested within groups.

      Any help in writing this method will be of great help to me.

      Thank you

      David**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Application Development Exploding Component Instances

      The loading time decreased from 2 minutes to 4 seconds. 👍

      Thanks Driven

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Application Development Exploding Component Instances

      **Dirven, I chose to use your method that works well.

      When components are exploded with dynamic materials, the textures will apply to the basic geometry.

      Thus the rendering engines can easily manage the maping coordinates to make beautiful 3D renderings.

      In the case of Click-Cuisine 2:

      Each piece of furniture can contain between 10 and 50 components to explode, so for a kitchen with 25 modules it takes 2 minutes of loading.

      I set the value "sleep", to "0" to go faster but that is insufficient.

      Is it possible to execute code faster or activate the SketchUp progress bar?

      Thank you**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Sketchup Pro 2017 et Pro 2016

      @boris vaisman said:

      ui, j'entends bien mais ce que je souhaiterais avoir, c'est que par défaut, l'enregistrement se fasse dans le format que je choisis (V6 par exemple) surtout pour les composants dynamiques car je travaille beaucoup avec.

      Salut Boris,

      Si tu aime les composants dynamiques faut oublier la version 6 de SketchUp, qui ne les prends pas en charges.

      Les composants dynamiques sont exploitables à partir de la version 7.

      Personnellement j’enregistre tous les composants de mes Plugins en version 8, se qui est largement suffisent pour un partage avec tous. 😉

      Je n'ai pas de solution automatique à te proposer, il faut juste que tu y pense à chaque fois.

      A plus

      David

      posted in Français
      TNTDAVIDT
      TNTDAVID
    • RE: Update! ça se rapproche et se précise!

      Que de belles présentations !

      Orgelf nous a fait rêver avec ces illustrations 3D incroyables.

      Vincent de BLB BOIS m'a scotché avec la grande technicité de ces Plugins en menuiserie. 👍

      SERGE nous un présenté un supère concept qui peut aider de nombreux étudiants. ( Bravo! )

      MISTER WHITE à mis en valeur V-Ray mieux que personne.
      DENIS fidèle à lui même nous à présenté l'avenir de la 3D! (Que des Machines à pain.) 💚

      Ce fut un grand plaisir de vous revoir les gars! 😛

      J'ai déjà hâte de participer au prochain "SketchUp Heroes"

      posted in Français
      TNTDAVIDT
      TNTDAVID
    • RE: Update! ça se rapproche et se précise!

      Dommage Patrick! 😐

      Çà tombe bien 13h30 car j'ai un rendez-vous ce matin. 😉

      Désolé de ne pas pouvoir venir donner un coup de main plus tôt.

      Ps: si j'arrive a me libérer, je viens le plus tôt possible.

      posted in Français
      TNTDAVIDT
      TNTDAVID
    • RE: Update! ça se rapproche et se précise!

      Dommage en effet. 😞

      A quel heure faut-il venir ?

      posted in Français
      TNTDAVIDT
      TNTDAVID
    • RE: Export Su vers IFC avec textures ?

      Hello, ☀

      Si Bimslight peu importer du "OBJ" ou "FBX, passe par ces formats pour conserver tes matériaux. 😉

      A plus

      David

      posted in Français
      TNTDAVIDT
      TNTDAVID
    • RE: Application Development Exploding Component Instances

      Really perfect your solution driven! 👍 👍 👍

      Thank you

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Application Development Exploding Component Instances

      Wonderful it works very well! ☀

      To explode several definitions, I simply did this:

      name=['Sophie','CUBE']
      model=Sketchup.active_model
      matches=model.definitions.find_all{|d| d.name =~ /#{name}/ }
      matches.each{|match| match.instances.each{|i| i.explode } }
      
      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Application Development Exploding Component Instances

      Bonjour TIG,

      Avec votre code:

      name="Sophie"
      model=Sketchup.active_model
      matches=model.definitions.each.find_all{|d| d.name =~ /#{name}/ }
      matches.each{|match| match.instances.each{|i| i.explode } }
      

      j’obtiens le message d'erreur suivant dans la console ruby:

      Error; #<LocalJumpError; no block given>
      <main>;2;in `each'
      <main>;2;in `<main>'
      -e;1;in `eval'
      nil
      

      Comment corriger cette erreur ?

      Merci

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Application Development Exploding Component Instances

      Hello, ☀

      I want to explode a list of nested components inside groups or components through their definitions.

      m=Sketchup.active_model
      s=m.selection
      sel=m.definitions.each{|d|s.add d.instances if d.name=~/#{"Sophie"}/}
      sophie=ents.grep(Sketchup;;ComponentInstance)
      sophie.each{|e| e.explode }
      

      With this code I select all "Sophie" in my SketchUp models and explode all the "Parents" components of "Sophie".

      How to explode "Shophie" without modifying the parent components?

      And how to explode the definition "Chris" at the same time as "Shophie"?

      Thank you in advance for your help.

      David

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      @sdmitch said:

      I think you need to use the same @@mod.definitions.find when checking for existence also.

      **It does not work yet. 😲

      For the code that makes it unique all of it is found. 😉

      Here is the example of the updated cube:

      TESTE 2.skp

      TNT_Teste.rbz

      **1.**Open the SKP file Teste 2.

      2. Install the extension.

      **3.**Click on the color icon. (All cubes will change texture.)

      **4.**Click the cube icon. (This will reload the subcomponents.)

      5. Select the middle cube and click on the padlock.

      6. Click the cube icon again, you will see that the sub-components of the middle cube will no longer change.

      7. Click on the color icon, the texture of the middle cube no longer changes. (Unfortunately this is not yet the case and I need your help to write this method.)

      Thank you

      David**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      **Thanks for your Sdmitch solution, but the definitions rendered unique "1-HANDLE # 1" still do not change.

      Maybe I made a mistake somewhere?

      def poignee
          @@mod = Sketchup.active_model
          @@ent = @@mod.active_entities
          @@avant = Sketchup.active_model.get_attribute("Handles","Last","1")
          @@next = @@avant.next
          @@next = '1' if @@next == '19'	
      	  
          @@last1 = "#{@@avant}-POIGNEE"
          @@next_name = "#{@@next}-POIGNEE"
      	  
      if  @@mod.definitions[@@last1]
          @@cd = @@mod.definitions[@@next_name]	
          unless @@cd
          cmp = File.join(Sketchup.find_support_file('plugins'),"TNT_ClickCuisine2/Components/#
          {@@next_name}.skp")
          @@cd = @@mod.definitions.load cmp
          end
          @@mod.definitions.find{|cd|cd.name=~/#{@@last1}?/i}.instances.each{|ci|ci.definition=@@cd}
          @@avant = @@next
          Sketchup.active_model.set_attribute("Handles","Last",@@next)
          else
          UI.messagebox "#{@@last1} not found."
        end
      end
      

      Perhaps it is more interesting not to reload the rendered unique models to find a solution to my 2nd Objective?

      Here is a simpler idea for the 2nd Objective:

      1 - I select a piece of furniture.

      2 - I Click on the icon "Freeze the model". (The method that is executed makes all unique components and subcomponents of my selection.)

      3 - I can execute the first code without changing the handles of the furniture made unique.

      How to write this method?

      Thanks in advance for your help.**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      **Great Thanks sdmitch.

      The general change of all the Handles furniture is finally perfect. 😉

      I will do the same for all the components of a kitchen, sink, taps, oven etc ...

      Thanks to your help, "Click-Cuisine 2" will be even easier than ever.

      A small remark without great consequence:

      The current code does not replace the unique handles, such as "1-HANDLE # 1".

      Is it possible to circumvent the problem, if so how?

      The 2nd Great Steps is to replace the Handles of a single piece of furniture selected, without affecting other furniture.

      How would you do that?

      Any help from you is very good news to me. 😄

      Thank you

      David**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      **There is news ☀

      As my code is in a class, I tried to apply the advises of TIG, put in "@@".

      Now "@@ next" continues to evolve from 1 to 19, even if the definition that needs to be replaced is not found.

      Even if the situation is better than before, it is not perfect because the code restarts to
      "1-Handle" every time SketchUp runs.

      If the handles on the stage are defined "5-Handle", you have to click 4 times on the icon to change the handle.

      Thank you in advance for your help.**

      def Handle
          @@mod = Sketchup.active_model
          @@ent = @@mod.active_entities
          @@avant ||= '1'
          @@next = @@avant.next
          @@next = '1' if @@next == '19'
      	  
          @@last1 = "#{@@avant}-HANDLE"
          @@next_name = "#{@@next}-HANDLE"
      	  
       if @@mod.definitions[@@last1]
          @@cd = @@mod.definitions[@@next_name]	
          unless @@cd
          cmp = File.join(Sketchup.find_support_file('plugins'),"TNT_ClickCuisine2/Components/#
          {@@next_name}.skp")
          @@cd = @@mod.definitions.load cmp
       end
          @@mod.definitions.find{|d|d.name==@@last1}.instances.each{|ci|ci.definition=@@cd}
          @@avant = @@next
       else
          UI.messagebox "#{@@last1} not found."
       end
      end
      
      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      **Hello,

      To replace several definitions with the "next name" definition, I tried this:

      def handles
            @mod = Sketchup.active_model
            @ent = @mod.active_entities  
            @last3 ||= '1' 
            @next = @last3.next
            @next = '1' if @next == '4' 
       
            last3_name = ['1-HANDLE','2-HANDLE','3-HANDLE']
            next_name = "#{@next}-HANDLE"
      
            if @mod.definitions[last3_name] && @mod.definitions[last3_name].instances[0]
            cd = @mod.definitions[next_name]
            unless cd
            cmp = File.join(Sketchup.find_support_file('plugins'),"TNT_ClickCuisine2/Components/#
            {next_name}.skp")
            cd = @mod.definitions.load cmp
            end
            @mod.definitions.find{|d|d.name==last3_name}.instances.each{|ci|ci.definition=cd}
            @last3 = @next
            else
            UI.messagebox "#{last3_name} not found."
            end
         end
      

      But the code does not work for a list of definitions between these brackets "[]".

      How to replace a list of definitions with the definition "next name" ?

      Any help would be of great help to me.

      Cordially

      David**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      **Sorry TIG to come back so late, but this time I finally have time to devote myself fully to ruby. ☀

      I would have to put "@@" into all the variables, but that is certainly not the solution you advise me. 💚

      Here is the basic code written by Sdmitch, which is almost perfect:

      def handles
            @mod = Sketchup.active_model
            @ent = @mod.active_entities  
            @last3 ||= '1' 
            @next = @last3.next
            @next = '1' if @next == '19'  
            last3_name = "#{@last3}-HANDLE"
      	  next_name = "#{@next}-HANDLE"
            if @mod.definitions[last3_name] && @mod.definitions[last3_name].instances[0]
            cd = @mod.definitions[next_name]
            unless cd
            cmp = File.join(Sketchup.find_support_file('plugins'),"TNT_ClickCuisine2/Components/#{next_name}.skp")
            cd = @mod.definitions.load cmp
            end
            @mod.definitions.find{|d|d.name==last3_name}.instances.each{|ci|ci.definition=cd}
            @last3 = @next
            else
            UI.messagebox "#{last3_name} not found."
            end
         end
      

      Before exploring your idea TIG:

      Can your solution manage multiple SKP files or the status of the handles are different for each file?

      For example :

      My Project 1 has been saved with the definition in "9-HANDLE".

      If I open this file the code must look for the definition "9-HANDLE", to replace it with "10-HANDLE".

      My Project 2 is saved in "4-HANDLE".

      If I open this file the code should look for the definition "4-HANDLE", to replace it with "5-HANDLE".

      Another example:

      If I go back with Sketchup, the code that is "4-HANDLE" will return to the "3-HANDLE" state.

      If your idea fulfills all these conditions can you write an example?

      Another idea would be to replace all the definitions that are called "Handle" in their definitions.

      For example:

      "1-Handle", "2-Handle" or "3-Handle" etc ...
      Are replaced because they contain the name "Handle" in their definitions.

      Is this easier to apply?

      If so, how will you change the code?

      Thank you in advance for your help.

      David**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Replace Several Textures?

      **Hello, ☀

      After some tests of your codes on Click-Cuisine 2, I noticed a small problem that I hope to solve with your help.

      The change of component changes perfectly from 1 to 2 then to 3, except if one goes backwards.

      Here is an example in image:

      http://i.imgur.com/J316OLS.gif

      Same problem, if I close and I open the file because the script restarts to "1-Component".

      How to work around the problem?

      I think it is best to delete the error message, even though "1-Component" is not found.

      You can download skp example below:

      TESTE.skp

      And below the rbz plugin:

      TNT_Teste.rbz

      Thank you in advance for your help.

      David**

      posted in Developers' Forum
      TNTDAVIDT
      TNTDAVID
    • RE: Orgelf_ mes travaux _ second topic

      Voici la preuve en image que la création virtuelle peu être considéré comme un art à part entière. 😉

      Travail incroyable qui nous permet de rêver. 👍

      posted in Français
      TNTDAVIDT
      TNTDAVID
    • 1
    • 2
    • 8
    • 9
    • 10
    • 11
    • 12
    • 36
    • 37
    • 10 / 37