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

    jshaz

    @jshaz

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

    jshaz Unfollow Follow
    registered-users

    Latest posts made by jshaz

    • RE: Question about Normal vector

      Hi guys, I'm trying to find the normal of a face that i have selected in my model I thought something similar to this script shown below might do the trick but alas it hasn't. The ruby console says I have an undefined method e. With my limited ruby brain I though this might be helped by making e = [] or e = 0 which of course it did not. I have used similar script to this below for finding areas. Any help or advice is greatly appreciated. Thanks

      <span class="syntaxdefault">model&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br />ents&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities<br />sel&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection<br />mat&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">sel</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">material&nbsp;&nbsp;</span><span class="syntaxcomment">#&nbsp;selected&nbsp;items&nbsp;with&nbsp;material&nbsp;we&nbsp;are&nbsp;interested&nbsp;in<br /></span><span class="syntaxdefault">normal_vector&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">0<br /></span><span class="syntaxcomment">#&nbsp;go&nbsp;through&nbsp;all&nbsp;the&nbsp;entities<br /></span><span class="syntaxdefault">ents</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each&nbsp;</span><span class="syntaxkeyword">do&nbsp;|</span><span class="syntaxdefault">e</span><span class="syntaxkeyword">|<br />if&nbsp;</span><span class="syntaxdefault">e&nbsp;is_a</span><span class="syntaxkeyword">?&nbsp;</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Face&nbsp;&nbsp;</span><span class="syntaxcomment">#&nbsp;if&nbsp;e&nbsp;is&nbsp;a&nbsp;face<br /></span><span class="syntaxkeyword">if&nbsp;</span><span class="syntaxdefault">e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">material</span><span class="syntaxkeyword">==</span><span class="syntaxdefault">mat&nbsp;&nbsp;</span><span class="syntaxcomment">#if&nbsp;e&nbsp;material&nbsp;is&nbsp;the&nbsp;material&nbsp;of&nbsp;the&nbsp;selected&nbsp;entity<br /><br />#&nbsp;normal&nbsp;equals&nbsp;initial&nbsp;normal&nbsp;vector&nbsp;plus&nbsp;the&nbsp;new&nbsp;normal&nbsp;vector<br />#this&nbsp;returns&nbsp;the&nbsp;normal&nbsp;of&nbsp;the&nbsp;selected&nbsp;face<br /></span><span class="syntaxdefault">normal_vector&nbsp;</span><span class="syntaxkeyword">=&nbsp;&nbsp;</span><span class="syntaxdefault">normal_vector&nbsp;</span><span class="syntaxkeyword">+&nbsp;</span><span class="syntaxdefault">face</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">normal<br /><br />end&nbsp;&nbsp;</span><span class="syntaxcomment">#end&nbsp;if<br /></span><span class="syntaxdefault">end&nbsp;&nbsp;</span><span class="syntaxcomment">#end&nbsp;if<br /></span><span class="syntaxdefault">end&nbsp;&nbsp;</span><span class="syntaxcomment">#end&nbsp;loop<br /><br /></span><span class="syntaxdefault">puts&nbsp;normal_vector</span>
      
      posted in Developers' Forum
      J
      jshaz
    • RE: Using script written in notepad++

      I can know save that file to my plugins folder thanks. I have encountered another stumbling block however, for some reason this file won't show up on my list of extensions i want to install or on my plugins dropdown in sketchup. any ideas how I might solve this? thanks for your help again.

      posted in Developers' Forum
      J
      jshaz
    • RE: Using script written in notepad++

      Thanks TIG, just made those changes now gonna see how it works.

      posted in Developers' Forum
      J
      jshaz
    • Using script written in notepad++

      Hi guys just tried to save some ruby script (.rb file) from notepad++ into my plugins. It says I need administrators permission to save it in this location. any advice on how to get around this. It's probably really obvious but my brain has decided to stop functioning. thanks.

      posted in Developers' Forum
      J
      jshaz