sketchucation logo sketchucation
    • Login
    1. Home
    2. morci429
    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!
    šŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 41
    • Groups 1

    Posts

    Recent Best Controversial
    • All faces with their backs facing the camera.

      how to get a list of all faces with their backs facing the camera. PLEASE HELP
      or even a list with all faces facing the camera

      posted in Developers' Forum
      M
      morci429
    • How make a window like the components window

      how make a window like the components window as an interface to represent a new class i made called Buildings

      posted in Developers' Forum
      M
      morci429
    • RE: Orient Faces

      Great, it does the job for me.
      Thanks again

      posted in Developers' Forum
      M
      morci429
    • RE: Over right the face class

      Tig you are right, using AttributeDeictionary is the right way to go and does exactly what i need.
      Thank you

      posted in Developers' Forum
      M
      morci429
    • Orient Faces

      There is a great tool in Sketchup tools called "Orient Faces" that its meant to turn all contiguous faces the same way as the one selected. Does anybody know how to invoke this tool in ruby script?
      For example i can make a list of certain faces that I’m sure they are properly oriented and then get all other faces connected to these faces and have them oriented to the ones I’m sure off using this function

      posted in Developers' Forum
      M
      morci429
    • Over right the face class

      Is there a way to over right the face class and add more functions to it?
      What I’m trying to do is add a Boolean attribute generically to the face class called looked_at.
      So that when i do my calculations i can check this variable and see if that face was looked at or not yet

      posted in Developers' Forum
      M
      morci429
    • Face front side outwards

      Hi All,
      I have a model of 300 buildings. I’m trying to apply certain materials to some facades on the model. But some of the facades represented by faces are inside out. Each face in sketchup has two sides and some of the faces in my model have the back side facing outwards of the building.
      My question is ā€œIs there a code or a plugin to use to flip all the faces that have the back side facing the outwards at once?ā€

      Thanks in advance

      posted in Developers' Forum
      M
      morci429
    • How to identify buildings in Sketchup using ruby?

      Hi guys,

      i was looking so ways to identify buildings in sketchup. one of the ideas i was thinking of is to search for 6 connected faces.. not very sufficient it was a start.
      any ideas to share??

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      Mission accomplished
      Thanks to you all Geniuses

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      guys i think you are right, the hits array is empty. the ray isn't hitting any geometry. Still trying to find out why though

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      Tig it isn't working.
      guys could u have a look at the code and tell me what do you think?

      ...*[snip]*... reposted [in later post](http://forums.sketchucation.com/viewtopic.php?f)
      
      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      Error: #<NoMethodError: undefined method []' for nil:NilClass> C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:31 C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:7:in each'
      C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:7
      C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:3:in `call'

      Sorry if i wasn't clear enough

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      Tig it isn't working.
      guys could u have a look at the code and tell me what do you think?

      
      require 'sketchup.rb'
      
      UI.menu("PlugIns").add_item("Fire Arrows") {
      
      ents = Sketchup.active_model.entities
      
      Sketchup.active_model.selection.each do |e|
      if e.is_a? Sketchup;;Face
      
      ce=e.bounds.center
      
      en=ce.offset(e.normal, 100000.mm)
      
      cl90=ents.add_cline(ce, en)   #a vertical line
      
      tr=Geom;;Transformation.rotation(ce, Z_AXIS, 45.degrees)
      en.transform!(tr)
      cl45=ents.add_line(ce, en)   #a 45 deg line
      
      
      vec=ce.vector_to(en)
      dist=ce.distance(en)
      
      hits=[]
      pt = Geom;;Point3d.new  
      pe=ce.clone ### set up a copy of the point to raytest from
      goon=true
      while goon
        rayt= Sketchup.active_model.raytest(pe, vec)
        goon=false if not rayt
        pt=rayt[0]
        hit=rayt[1][0]
        goon=false if ce.distance(pt) > dist
        hits << [pt, hit]
        pe=pt ### look from last hit point...
      end#while
      
      
      hits.each do |s|
      if s[1][0].is_a? Sketchup;;Face
      hit_face = s.bounds
      zmin = hit_face.min.z
      zmax = hit_face.max.z
      h = zmax - zmin
      h = h.to_m
      UI.messagebox s[1][0]
      UI.messagebox h
      end
      end
      
      
      tr=Geom;;Transformation.rotation(ce, Z_AXIS, -90.degrees)
      en.transform!(tr)
      cl135=ents.add_cline(ce, en)  #a 135 deg line
      
      #en=ce.offset(Z_AXIS, 5000.mm)
      
      #tr=Geom;;Transformation.rotation(ce, X_AXIS, -45.degrees)
      #en.transform!(tr)
      #cl135=ents.add_cline(ce, en)  #a 135 deg line
      
      #tr=Geom;;Transformation.rotation(ce, X_AXIS, 90.degrees)
      #en.transform!(tr)
      #cl135=ents.add_cline(ce, en)  #a 135 deg line
      
      
      
      end
      end
      }
      

      Thanks Dan,
      i added the two end statements. but the complier doesn't like line 31 ]

      pt=rayt[0]
      

      thanks again Dan

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      Guys sorry i don't mean to be pushy, put after i fired the arrow from centroid I’m looking for a built in function in either add_cline or even add_line to retrieve all the faces that intersect with my line.

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      Thank you so much guys I’m starting to feel like you are magicians šŸ˜„

      posted in Developers' Forum
      M
      morci429
    • RE: How to draw an edge with an angle and distance

      yes i want to draw construction lines from centroid for a distance D with angle A

      Any ideas?
      i looked at the links and i still can't see how can i specify an angle

      P.S i don't know the coordinates of the point the arrow going to stop at

      posted in Developers' Forum
      M
      morci429
    • How to draw an edge with an angle and distance

      Hi all,

      As i found the best ruby programmers on this forum, i was wondering if anybody can help do this:

      i managed to work out centeroid of a face now i need to fire three arrows from the point vertically with angels of (45, 90, 135) degrees.

      i know that i can make an edge giving two defined points.
      edg = ents.add_edges point1, point2

      But is there any way to draw an edge with a certain angle and a giving length of 500 MM for example??

      posted in Developers' Forum
      M
      morci429
    • RE: Rounding

      Many thank everyone

      Dan Rathbun you are a genies

      posted in Developers' Forum
      M
      morci429
    • Rounding

      Hi everyone,

      As you all know i'm knew to Sketchup ruby and i can't find this anywhere online.
      I have a variable that has a float number and i wanted to round it.

      Var = 1.8854523497846
      Desired answer Var = 1.9

      Also if i can recommend any online sources for Sketchup ruby I’ll be thankful

      Thanks

      posted in Developers' Forum
      M
      morci429
    • RE: Detect units using ruby

      @thomthom said:

      Look at model.options http://code.google.com/apis/sketchup/docs/ourdoc/model.html#options

      OptionsProvider http://code.google.com/apis/sketchup/docs/ourdoc/optionsprovider.html
      OptionsManager http://code.google.com/apis/sketchup/docs/ourdoc/optionsmanager.html

      Remember to use the keys to access the options as indexes vary from version to version.

      To print out all available options for a given version, use this on-liner:

      <span class="syntaxdefault"><br />Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">options</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">keys</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">eachĀ </span><span class="syntaxkeyword">{|</span><span class="syntaxdefault">key</span><span class="syntaxkeyword">|</span><span class="syntaxdefault">Ā pĀ key</span><span class="syntaxkeyword">;</span><span class="syntaxdefault">Ā Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">options</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">key</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">eachĀ </span><span class="syntaxkeyword">{|</span><span class="syntaxdefault">k</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">v</span><span class="syntaxkeyword">|</span><span class="syntaxdefault">Ā putsĀ </span><span class="syntaxstring">">Ā #{k}Ā -Ā #{v}"</span><span class="syntaxkeyword">}</span><span class="syntaxdefault">Ā </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">Ā </span>
      

      THANK YOU VERY MUCH. it worked

      posted in Developers' Forum
      M
      morci429
    • 1 / 1