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

    Topics

    • K

      Back_material of a face

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      171 Views
      K
      working meanwhile... thanks for the help.
    • K

      Hiding an Entity

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      114 Views
      K
      Great! Thank you.
    • K

      Deleting entities on a layer doesn't work

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      568 Views
      K
      I study civil engineering and the script is some kind of homework. I'll talk to my tutor in two days. After that I'll know wether I'm allowed to give you the code. Thanks so far. Tim
    • K

      Deleting a layer

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      1k Views
      Dan RathbunD
      The erase!() method is defined in class Sketchup::Drawingelement Sketchup::Layer is a subclass of Sketchup::Entity, NOT a subclass of Sketchup::Drawingelement, so it does not inherit a erase!() method. You will need to move all entities off of the layer, then use Layers.purge_unused() BTW.. Layers is a C++ collection, not a Ruby Array.
    • K

      Deleting an observer

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      343 Views
      Dan RathbunD
      You should always be running your code within your OWN namespace, so using a global variable is NEVER needed. I use @@ module vars to hold references to observers. YES you can write a method within your observer class that can remove itself. I do this sometimes, and it is really just a wrapper for the remove_observer() method. This example assumes your using your Observer in a Singleton manner: class MySelectionObs < Sketchup;;SelectionObserver @@watched = [] def attach(selection) raise(TypeError,"argument is not a Sketchup;;Selection object.") unless selection.class==(Sketchup;;Selection) if selection.class==(Sketchup;;Selection) && (not self.watching?(selection)) selection.add_observer(self) @@watched << selection end end def dettach(selection) raise(TypeError,"argument is not a Sketchup;;Selection object.") unless selection.class==(Sketchup;;Selection) if selection.class==(Sketchup;;Selection) && self.watching?(selection) selection.remover_observer(self) @@watched.delete(selection) end end def verify_watchlist() unless @@watched.empty? @@watched.delete_if {|e| e.class != Sketchup;;Selection } @@watched.delete_if {|e| !e.model.valid? } end end def watching() verify_watchlist() return @@watched.dup end def watching?(selection) raise(TypeError,"argument is not a Sketchup;;Selection object.") unless selection.class==(Sketchup;;Selection) verify_watchlist() return @@watched.include?(selection) end ### define your other callback methods ### end # class ONE BIG EXCEPTION : NEVER dettach (remove) observers within the onQuit() callback of an AppObserver subclass instance !! A BugSplat! will occur.
    • K

      Selectionobserver

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      697 Views
      K
      hmmm... ok. in this case i don't understand why the lines behaved like that. not that important. ok, thanks to you once again.
    • K

      Text in the corner of a rendered image

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      332 Views
      Dan RathbunD
      I posted a blurp at the bottom of the API page: @dan said: Model.add_note returns a Sketchup::Text object associated with the View (has no point, leader or arrow.) [ie, there is no such object class as Note or Sketchup::Note.] Bug: (on PC as of v7.1,) The note (Text object,) will NOT be displayed if there are no other DrawingElements to render. A note added to an empty model will not be displayed until some element is added to the model. If all other DrawingElements execpt the note are deleted, the note will NOT be displayed (but is still in the Entities collection.) So modify the previous example: mynote = model.add_note "test", 0.1, 0.1 ... later in the code, delete the Sketchup::Text object referenced by mynote mynote.erase! or Sketchup.active_model.entities.erase_entities( mynote )
    • K

      Deleting a text

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      589 Views
      K
      oh, ok, great. thank you!
    • K

      Opening the ruby console

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      203 Views
      TIGT
      http://sketchuptips.blogspot.com/2007/08/plugin-ruby-toolbar.html Takes it a step further and also adds a toolbar button to do it for you - using the same Sketchup.send_action("showRubyPanel:") as Pixero suggested...
    • K

      Array doesn't work...

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      372 Views
      K
      Works! Thank you!
    • K

      Moving 3d text

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      794 Views
      K
      works . thanks a lot.
    • K

      Checking wether material exists before declaring it

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      189 Views
      K
      Ok, great. thank you. I'll change it this weekend. Hope you have a nice one Bye. Tim
    • K

      Materials again

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      222 Views
      K
      it works. thanks a lot, once more tommorow t'll try to declare the material in the constructor of the class anyway, to avoid putting all the trash in the memory. bye. tim
    • K

      Saving an reloading a material from an attribut

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      18
      0 Votes
      18 Posts
      706 Views
      K
      me again... i don't know why, but the attribut "ablauf", "material" always receives a new value, even if the face's material is included in the array caled invalid_material. i'll post the code, because i realy don't know how to fix it. ents.each{|e| if e.typename == "Face" start = e.get_attribute "ablauf", "baubeginn" ende = e.get_attribute "ablauf", "bauende" if (e.material) invalid_materials = ['bau_mat', 'fertig_mat', 'inplanung'] unless invalid_materials.include?( e.material.name ) mat_vorher = e.material.name e.set_attribute("ablauf", "material", mat_vorher) end end if @woche.to_i >= start.to_i && @woche.to_i < ende.to_i e.material = bau_mat end if @woche.to_i >= ende.to_i e.material =fertig_mat end if @woche.to_i < start.to_i e.material = inplanung end end } end #now the code that reloads the material def mat_back mod = Sketchup.active_model ents = mod.entities mats = mod.materials default_mat = mats.add "standardwert" default_mat.color = [50,250,50] ents.each{|e| if e.typename == "Face" if (e.get_attribute "ablauf", "material") mat_temp=e.get_attribute "ablauf", "material" e.material=mats[mat_temp] else e.material=default_mat end end } end
    • K

      Creating an avi file with a plugin

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      716 Views
      P
      hmm tried mencoder a lot of times and it is not that easy to get ruby running the mencoder line in a command window (things with locatiosn of the imgages and the mencoder exe come back to mind) ffmpeg is easier
    • 1 / 1