sketchucation logo sketchucation
    • Login
    1. Home
    2. kiesewetter
    ℹ️ 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

    kiesewetter

    @kiesewetter

    10
    Reputation
    1
    Profile views
    44
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    kiesewetter Unfollow Follow
    registered-users

    Latest posts made by kiesewetter

    • RE: Back_material of a face

      working meanwhile... 😳

      thanks for the help.

      posted in Developers' Forum
      K
      kiesewetter
    • RE: Back_material of a face

      But that part of the code:

      
      if @woche.to_i >= start.to_i && @woche.to_i < ende.to_i #@woche variable of the class
          e.material = mats["im_bau"]
          e.back_material = mats["im_bau"] #why doesn't it work?
      end
      if @woche.to_i >= ende.to_i
          e.material =mats["fertig"]
          e.back_material =mats["fertig"]  #why doesn't it work?
      end
      if @woche.to_i < start.to_i
          e.material = mats["noch_nicht_angefangen"]
          e.back_material = mats["noch_nicht_angefangen"]  #why doesn't it work?
      end
      

      should have been working, shouldn't it?
      I don't understand why the materials were assigned to the front, but not to the back of the face.
      any idea?

      posted in Developers' Forum
      K
      kiesewetter
    • Back_material of a face

      Hallo!

      I am going to set the material of a face in the following method. To avoid problems with the oriatation of the face's normal I want to set its back_material, too.
      I tried it with the following code:

      
      def status_anzeigen #funktioniert, nur das mit dem alpha wert im material inplanung noch nicht so
        mod = Sketchup.active_model
        ents = mod.entities 
        sel = mod.selection 
        mats = mod.materials
        bau_mat = mats.add "im_bau" if not bau_mat = mats["im_bau"]
        bau_mat.color = [255,127,38] 
        fertig_mat = mats.add "fertig" if not fertig_mat =mats["fertig"]
        fertig_mat.color = [211,211,211] 
        inplanung = mats.add"noch_nicht_angefangen" if not inplanung = mats["noch_nicht_angefangen"]
        inplanung.color = [176,196,222] 
        inplanung.alpha = 0.3 
      
        ents.each{|e|
                  if e.typename == "Face"
                       start = e.get_attribute "ablauf", "baubeginn"  #attributes that were assigned to the faces before
                       ende = e.get_attribute "ablauf", "bauende"     #attributes that were assigned to the faces before
                       
                      if (e.material) #checking wehther the faces current material belongs to the ones created at the top of the method, if not, save the name of the current material as an attribut
                   
                         invalid_materials = ["im_bau", "fertig", "noch_nicht_angefangen"]
                         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 #@woche variable of the class
                         e.material = mats["im_bau"]
      				   e.back_material = mats["im_bau"] #why doesn't it work?
                       end
                       if @woche.to_i >= ende.to_i 
                         e.material =mats["fertig"]
      				   e.back_material =mats["fertig"]  #why doesn't it work?
                       end
                       if @woche.to_i < start.to_i 
                         e.material = mats["noch_nicht_angefangen"]
      				   e.back_material = mats["noch_nicht_angefangen"]  #why doesn't it work?
                       end
                  end
                       
                 }
      end
      

      Only the "front" of the face was changed to the new material. Does anybody know what mistake I made?
      Thanks for your time.
      Tim

      posted in Developers' Forum
      K
      kiesewetter
    • RE: Hiding an Entity

      Great!
      Thank you.

      posted in Developers' Forum
      K
      kiesewetter
    • Hiding an Entity

      Hallo!

      How is it possible to hide and unhide an entity?

      Thanks for your time.

      posted in Developers' Forum
      K
      kiesewetter
    • RE: Deleting entities on a layer doesn't work

      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

      posted in Developers' Forum
      K
      kiesewetter
    • RE: Deleting entities on a layer doesn't work

      Step by step what I want to do:

      1. a scribt assigns information to selected faces of the model as attributes.
      2. another one creates a bar chart (the entities that should be erased later) based on the attributes of the faces on a layer called "balkenlayer".
      3. a selection observer is used to go back to the model to go on working on it. that observer should delete the bar chart (everything on the layer "balkenlayer").
      4. later it schould be possible to invoke the script that created the bar chart once more.

      it is working so far. in the 3. step every entity on that layer seems to be erased. but if i invoke the scribt once more as mentioned in step 4, sketchup tells me:

      "your recent operation has caused visible geometry to merge with existing geometry on a hidden layer"

      although the is nothing to see.
      do know now what i am trying to receive?
      is there maybe an array that stores the entity although it got erased or something like that?

      thank you guys for your time.

      posted in Developers' Forum
      K
      kiesewetter
    • RE: Deleting entities on a layer doesn't work

      The geometry isn't disconected. I wrote a scribt that should display some information, that is saved as an attribute of the faces, in a diagramm an text on a different layer ("balkenlayer"). Then it should be possible to go on working on the model and to invoke the scribt that shows the information on "balkenlayer" again. So far the diagramm and the text is displayed on the layer and the geometry of it seems to be erased. But when I invoke the scribt one more time, Sketchup still tells me, that:

      "your recent operation has caused visible geometry to merge with existing geometry on a hidden layer"

      Although I meanwhile use the following code:

      layer = layer_array["Balkenlayer"]
      	  return nil if not layer
      	  mod.entities.to_a.each{|e| next if not e.valid?; e.erase! if e.layer==layer}
      

      I don't understand why.Though there is no geometry to see if only the "Balkenlayer" is visible.
      Any idea?

      posted in Developers' Forum
      K
      kiesewetter
    • RE: Deleting entities on a layer doesn't work

      But isn't that exactly the code I already used?

      posted in Developers' Forum
      K
      kiesewetter
    • Deleting entities on a layer doesn't work

      Hallo!

      I wrote a scribt that creates some entity objects on a layer called "Balkenlayer". Now I try to write a scribt that deletes every entity object on "Balkenlayer" to be able to execute the first scribt I wrote more then only one time without having the entity objects created by the first invoking of the scribt on the layer.

      As adviced I used

      mod = Sketchup.active_model
      mod.active_entities.to_a.each{|e| next if not e.valid?; e.erase! if e.layer==layer_array["Balkenlayer"] }
      

      to delete the objects on Balkenlayer. But every time I invoke the first scribt that created the objects on "Balkenlayer" after the should have been deleted, Sketchup opens a window that tells me:
      "your recent operation has caused visible geometry to merge with existing geometry on a hidden layer"

      In the next step nothing happens.
      Do you know what I have to change?
      Thanks for your time.
      Tim

      posted in Developers' Forum
      K
      kiesewetter