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

    MaryamR

    @MaryamR

    10
    Reputation
    1
    Profile views
    34
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online
    Age 31

    MaryamR Unfollow Follow
    registered-users

    Latest posts made by MaryamR

    • RE: Find to which face a door belong

      thnx for your answer.

      there is a cases where a model can contain 2 windows linked to a door like the model below, but it doesn't appear using your code


      Screenshot (26).png


      data extraction.skp

      posted in Developers' Forum
      M
      MaryamR
    • Find to which face a door belong

      hello everyone,

      i have a model and i need to detect which face contains a door, i managed to detect windows using the outer and inner loops but it doesn't work on doors as the door has an edge that is common between the face and the floor.

      this is the code i use to detect windows and find to which face they belong:

      model = Sketchup.active_model
      ents= model.active_entities
      ents.each do |f|
      if f.is_a? Sketchup;;Face
      inner_loops = (f.loops - [f.outer_loop])
         nested_faces = []
         inner_loops.each{|loop|
        loop.edges[0].faces.each{|e|
           nested_faces << e unless e == f
        }
         }
         if nested_faces.empty?
        
        UI.messagebox("Face; #{f.material.display_name} has no windows ")
      	  
         else
       
         nested_faces.each{|ff|
       
      	 UI.messagebox("Face; #{f.material.display_name} contains the window #{ff.material.display_name} ")
        
         }
        
         end
         end
         end
      
      

      how can i change my code so that it detects doors also ?
      thnx a lot.

      that's the model where i'm testing the doors' detection.


      the model's image


      the model skp file

      posted in Developers' Forum
      M
      MaryamR
    • Ruby API and Ruby classes

      Hello everyone,

      i working on a sketchup plugin and i want to ask you, is it obligatory to have the entire program in one .rb file or is it possible to have a plugin with muliple classes ?

      For example class House, class Type ... and each class will contain methodes that will be used in one plugin.

      so is it possible to do so ? if yes how ?

      thnx in advance.

      posted in Developers' Forum
      M
      MaryamR
    • RE: Knowing that a face contains another face using Ruby API ?

      oh oky i understand now, thank you soo much this realy helped (y)

      posted in Developers' Forum
      M
      MaryamR
    • RE: Knowing that a face contains another face using Ruby API ?

      Hello TIG thnx for your answer.
      i didn't really understand this part:

      @unknownuser said:

      PS:
      You might also want to check for the two faces having the same plane, and face.normal etc unless you can be sure that the faces are 2d and coplanar, and every edge has just one or two faces..

      did you meant that it will only work if the faces who contain other faces are in the same plane ? and not for faces who are in an other side ? like this image, in case of the blue face (face H) on the right it also has a face in it (face X) so would it create a problem as it's not in the same plane as the other faces ?


      Screenshot (10).png

      posted in Developers' Forum
      M
      MaryamR
    • RE: Knowing that a face contains another face using Ruby API ?

      TIG i tried your method i used this code:

      model = Sketchup.active_model
        ents = model.active_entities
      ents.each do |f|
      if f.is_a? Sketchup;;Face
      
      loops = f.loops-[f.outer_loop] 
      nested_faces=[]
      loops.each{|loop|
        nested_faces << loop.face 
      }
      nested_faces.flatten!
      nested_faces.uniq!
      for i in (0..nested_faces.length) do
      if nested_faces[i]!=nil
      UI.messagebox("face #{f.material.name} in face #{nested_faces[i].material.name}")
      end
      end
      end
      end
      
      

      but the messagebox shows :

      face B_material is in B_material
        face E_material is in E_material 
        face G_material is in G_material
      

      but i want it to show :
      face A_material is in B_material
      so as to know both face B and A so that i can calculate the sum of their areas
      how can i do that ?

      posted in Developers' Forum
      M
      MaryamR
    • RE: Knowing that a face contains another face using Ruby API ?

      thank you so much for your answer i'll try that

      posted in Developers' Forum
      M
      MaryamR
    • Knowing that a face contains another face using Ruby API ?

      Hello everyone i have this 3D model on Sketchup, and i need to get the areas of diffrent faces using Ruby Sketchup API:
      For example :

      @unknownuser said:

      -for the first face on the left, i need to say that the face has a total area of 1.55 m² which is the area of the B face + the area of the A face, and say that this face has another face (A) in it and it's area is 0.06 m².
      And same for other faces (E and G).

      How can i find that the face B contains the face A and not C or D ? because all face have the same material and have random x,y,z coordinates.

      thank you in advance


      Screenshot (4).png

      posted in Developers' Forum
      M
      MaryamR
    • RE: Geocoder for Sketchup Ruby API

      No it's not built inside google map.

      i'm creating a model of a house that exists in real life, ad i write it's address in an inputbox.

      now i want to creat a plugin that shows the location of that house on google map based on the address i wrote .

      posted in Developers' Forum
      M
      MaryamR
    • Geocoder for Sketchup Ruby API

      hello everyone,

      I'm trying to create a model of a house that exists in real life, and add an inputbox where the user can write the actual address of that house and then show location of that building in Google Maps.

      i tried to install geocoder: Gem.install("geocoder")

      but it doesn't find it:

      Gem.install("geocoder")
      Error; #<Gem;;SpecificGemNotFoundException; Could not find a valid gem 'geocoder' (>= 0) locally or in a repository>
      C;/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/dependency_installer.rb;301;in `find_spec_by_name_and_version'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/dependency_installer.rb;110;in `available_set_for'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/dependency_installer.rb;322;in `install'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems.rb;526;in `install'
      <main>;in `<main>'
      SketchUp;1;in `eval'
      

      does this gem works only for Ruby on Rails and Sinatra .. ? is there another gem like geocoder that is used for the Ruby Sketchup API ?

      thank you a lot.

      posted in Developers' Forum
      M
      MaryamR