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

    Posts

    Recent Best Controversial
    • RE: How detect that a file is locked by another app?

      This works on my mac,

      out_name = UI.savepanel('Location', '' , "#{File.basename(Sketchup.active_model.path).sub('.skp','.txt')}")
      if out_name
         if File.extname(out_name).downcase != ".txt"    # if the user erase the extension, rewrite it!
            out_name += ".txt"
         end
         File.open(out_name , 'w') { |file|
         file.puts(%Q["blabla"])
         }
      end
      

      in my Add_Note extension, I use this...

      module JcB
      
        module Add_Note
      
      #----------------------------------------------------------------------------------------#
      
          def self.note2self
      
            mod = Sketchup.active_model
            mod_path = mod.path
            if mod_path.empty?
              Sketchup.send_action('saveDocument;' )
              UI.messagebox("Save with name and Try Again")
            else
              time = Time.now
              txt_path = mod_path.sub('.skp', '.txt')
              File.open(txt_path, "a+") { |file| file.puts("\n" + time.ctime) }
              UI.openURL('file;///' + txt_path)
              return 'note2self done'
            end #  mod_path.empty?
      
          end #  note2self
      
      #----------------------------------------------------------------------------------------#
      
        end # Add_Note
      
      end # JcB
      
      JcB;;Add_Note.note2self
      

      john

      posted in Developers' Forum
      D
      driven
    • RE: Intermittent component placement weirdness

      sounds like a reversed faces scenario...

      are all faces showing the 'front' face?

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: Glue to components and stretching walls

      @rv1974, do you always 'model' in 'Parallel Projection'?

      that can to cause weird outcomes unless using 'Standard Views' i.e. no orbiting...

      Peter, I assuming you don't...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: Force Display of 0"

      it will always show feet and inches even if the inches are zero...

      e.g. 6' 0"

      john

      posted in Newbie Forum
      D
      driven
    • RE: (Not Responding) How long would you wait???

      if you have 4/5 cores, 29% could represent a single core near 100% plus some overhead for system on other chores...

      SU only uses a single core for it's background activities...

      on my core duo I'd see 50 > 55 percent when SU is working hard...

      you need to supply your system details, to make it easier to help...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: (Not Responding) How long would you wait???

      there are two flavours of 'not responding'...

      if one core of your CPU is maxed out, then waiting can eventually end...

      if there is minimal CPU usage, something has probably gone wrong and waiting won't help...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: Starting a process in background using Ruby system()

      some zip program require the .zip extension, so you could try using rename...

      I'm on a mac, but maybe something like...

      zip = "c;/program files/7-zip/7z"
      zipped = "c;/users/public/sketchup/plugins/dummy tool.zip" 
      rbz = "c;/users/public/sketchup/plugins/dummy tool.rbz"
      rb = "c;/users/public/sketchup/plugins/dummy tool.rb"
      cmd = "\"#{zip}\" a -tzip \"#{zipped}\" \"#{rb}\""; puts cmd
      %x('start "" ' + cmd)
      File.rename(zipped, rbz)
      
      

      john

      posted in Developers' Forum
      D
      driven
    • RE: 'protecting' a dynamic component?

      @halroach said:

      ...I got it to work on my own DC, but not on the one you sent...

      I may have attached the wrong one as it was a quick proof of principle, and I had made a few...

      @unknownuser said:

      What would prevent if someone just right clicks the DC and "save as" to some folder

      there are lots of situations where the 'raw' DC could be 'pirated', but if they start out encrypted they need your ruby for them to work...

      that gives you an advantage as you can add observers. etc... to react to events...

      any copy event is a potential threat and may be the price you have to pay for the convenience you gain using DC's in favour of bespoke geometry creation...

      john

      posted in Dynamic Components
      D
      driven
    • RE: File size differences

      I ran a modified version of kaas's code and it shows every faces has it's own attribute dictionary...

      #<Sketchup;;Face;0x007f8087113078>
      #<Sketchup;;AttributeDictionaries;0x007f80878cf578>
      FredoTools_ThruPaint
      #<Sketchup;;Face;0x007f8087112e98>
      #<Sketchup;;AttributeDictionaries;0x007f80878cf488>
      FredoTools_ThruPaint
      #<Sketchup;;Edge;0x007f80878cf438>
      #<Sketchup;;AttributeDictionaries;0x007f8083f09b68>
      FredoTools_ThruPaint
      #<Sketchup;;Face;0x007f8087112c18>
      #<Sketchup;;AttributeDictionaries;0x007f80878cf348>
      FredoTools_ThruPaint
      
      model = Sketchup.active_model
      sel = model.selection
      sel.clear
      ents = model.active_entities.to_a
      view = model.active_view
      model.start_operation("declutter",true)
      count = 0
      ents.each {|s| sel.add(s)
      view.refresh
      count += 1
         attrdicts = s.attribute_dictionaries
         if attrdicts
            attrdicts.each{|d|
               p s, attrdicts if count < 20
               puts d.name if count < 20
               attrdicts.delete d
            }
            
         end
      }
      model.commit_operation
      

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: File size differences

      @chrisjmitchell said:

      ...How did you know that?

      I run Enroth's Attribute Inspector on both to see what was there...

      I used it to 'clear' those found, but it didn't make it any smaller, hence I recommended remaking...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: File size differences

      @chrisjmitchell said:

      ... the bigger one is what I modified for 3d printing.

      you also used 'Thru Paint' and 'Twilight' on it and they left a number of embedded attributes...

      even when purged the file size remains disproportionate to the minor changes between the two files, so I believe the attributes 'have' corrupted the file...

      I've noticed this before with 'Thru Paint' but can't quite see what goes wrong...

      I would remake the 3d print version from the original and not 'play around' before saving it as a component...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: 'protecting' a dynamic component?

      my thinking is that it's relatively easy to 'break' a DC so that it won't work...

      it is also easy to share encrypted/broken DC's...

      one way is to 'transfer' the attributes to a new 'encrypted' dictionary...

      if you import this 'encrypted' DC into SU, it will not work, but if you 'decrypt' it using you 'secret' key, it will...

      encrypted example stairs DC
      you can check if it has any dynamic attributes and even if you use ruby you won't know what they are...

      i.e. this random example ["_vhMZmDddZ_0dYeZMOmZ", "WhMZmlddZ"]

      if you load this ruby into Ruby Console

      use load for a test...
      and then type

      JcB.fix_dc
      

      the DC will then work as designed...

      click to gif...

      if you use

      JcB.break_dc
      

      it will encrypt all DC's in the model...

      This is only part of the puzzle and you still need to implement a 'License Strategy'...

      it would need to tie the lic to the encryption key and implement 'model observer' triggering of the encryption code...

      think of all the ways people can extract a working version and write code to block it happening...

      john

      posted in Dynamic Components
      D
      driven
    • RE: Adopt texture from face directly below

      adding the skp file would help us in suggesting workflows...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: Visualizer for SketchUp

      Applications/SketchUp 2016 is the one I refer too...

      john

      posted in Extensions & Applications Discussions
      D
      driven
    • RE: Old Slice Plug-in

      was it Zorro2?

      john

      posted in Plugins
      D
      driven
    • RE: Unable to authorize sketchup pro 2015

      @unknownuser said:

      ... i thought i read somewhere that this blockage was being planned by trimble...

      it's been like this since the first v1 upgrade of SU, before Google or Trimble...

      other software immediately overwrites any older version, but SU has always [and still does] allows you to 'keep' previous versions on the system it was installed on...

      I recently lost my hard drive that had v5 >> v16 Pro and now only have the current 'Pro' version...

      I'm staring to see i more as a blessing, than a curse...

      there are also many other paid for apps, I haven't bothered to re-install, even though I own a license...

      my cleaner leaner machine is at least twice as fast as it was...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: Visualizer for SketchUp

      Visualizer will not install in SketchUp v16 without tricking it to do so...

      temporarily renaming SketchUp 2016 folder in Finder to SketchUp 2015 will allow the download to make the the v15 files...

      once downloaded, change the name back and run the ruby code posted in the post above...

      john

      posted in Extensions & Applications Discussions
      D
      driven
    • RE: Help! Parrallel View skew--cannot change!

      Camera >> Previous

      takes you back...

      john

      posted in SketchUp Discussions
      D
      driven
    • RE: Visualizer for SketchUp

      @ct200224 said:

      Hey, I'm having a lot of trouble locating Visualizer plugins on my SketchUp.... It doesn't seem to be showing up at all.

      if you run this in 'Ruby Console' it will move a copy for you into the v16 User/Library...

      If you read through the thread, you should have seen that the v15 path is for the HD/Library...

      v15_folder = "/Library/Application Support/SketchUp 2015/SketchUp/Plugins/ImaginationVisualizer"
      v15_extension = v15_folder + '.rb'
      
      v16_folder = File.expand_path("~") + v15_folder.sub('5', '6')
      v16_extension = v16_folder + '.rb'
      
      command = 'ditto ' + v15_folder.inspect + ' ' + v16_folder.inspect + ' && ' + \
      'ditto ' + v15_extension.inspect + ' ' + v16_extension.inspect
      
      system(command)
      

      john

      posted in Extensions & Applications Discussions
      D
      driven
    • RE: Circles &lt;&gt; Squares

      very interesting illusion...

      john

      posted in Corner Bar
      D
      driven
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 148
    • 149
    • 6 / 149