<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Poly - select by angle - getting the number of selected faces by angle in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008388#M27096</link>
    <description>What I'm trying to do, is to be able to select by angle,&lt;BR /&gt;then select each face of the model, to check if it finds&lt;BR /&gt;more then 1 face within the threshold..&lt;BR /&gt;Reason for this is that i want to make a script that removes holes&lt;BR /&gt;in meshes (Mechanical models), i want to get rid of all bolt holes etc.&lt;BR /&gt;&lt;BR /&gt;Image of test model is attached, a box with cylinder boolean.&lt;BR /&gt;&lt;BR /&gt;So if i do this manualy it works.. but i want to script it. And i'm now stuck.&lt;BR /&gt;If i select the top\side polys with a angle of 30, then it select 1 face,&lt;BR /&gt;but when you select the inside (The hole) it selects 18 faces.&lt;BR /&gt;this is what i want to be able to detect..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) Select by angle&lt;BR /&gt;2) select one face by angle, if it selects more then X polygons i want it to tell me.&lt;BR /&gt;3) go to next face and continue.&lt;BR /&gt;&lt;BR /&gt;Current code is posted here:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;thePoly = selection&lt;BR /&gt;select thePoly&lt;BR /&gt;numFaces = (polyop.getNumFaces thePoly)&lt;BR /&gt;for v = numFaces to 1 by -1 do &lt;BR /&gt;(&lt;BR /&gt;    thePoly.selectByAngle = on&lt;BR /&gt;    thePoly.selectAngle = 30&lt;BR /&gt;    polyop.setFaceSelection $ v&lt;BR /&gt;    facename = getFaceSelection $ --here is where i want it to return the number of selected poly's it's selected&lt;BR /&gt;    print facename&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migr-att-link" src="http://area.autodesk.com/userdata/forum/7/7856_jPv7UOnnIVFHsUOVtaTw.jpg" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 May 2008 16:11:32 GMT</pubDate>
    <dc:creator>stigatle</dc:creator>
    <dc:date>2008-05-07T16:11:32Z</dc:date>
    <item>
      <title>Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008388#M27096</link>
      <description>What I'm trying to do, is to be able to select by angle,&lt;BR /&gt;then select each face of the model, to check if it finds&lt;BR /&gt;more then 1 face within the threshold..&lt;BR /&gt;Reason for this is that i want to make a script that removes holes&lt;BR /&gt;in meshes (Mechanical models), i want to get rid of all bolt holes etc.&lt;BR /&gt;&lt;BR /&gt;Image of test model is attached, a box with cylinder boolean.&lt;BR /&gt;&lt;BR /&gt;So if i do this manualy it works.. but i want to script it. And i'm now stuck.&lt;BR /&gt;If i select the top\side polys with a angle of 30, then it select 1 face,&lt;BR /&gt;but when you select the inside (The hole) it selects 18 faces.&lt;BR /&gt;this is what i want to be able to detect..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) Select by angle&lt;BR /&gt;2) select one face by angle, if it selects more then X polygons i want it to tell me.&lt;BR /&gt;3) go to next face and continue.&lt;BR /&gt;&lt;BR /&gt;Current code is posted here:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;thePoly = selection&lt;BR /&gt;select thePoly&lt;BR /&gt;numFaces = (polyop.getNumFaces thePoly)&lt;BR /&gt;for v = numFaces to 1 by -1 do &lt;BR /&gt;(&lt;BR /&gt;    thePoly.selectByAngle = on&lt;BR /&gt;    thePoly.selectAngle = 30&lt;BR /&gt;    polyop.setFaceSelection $ v&lt;BR /&gt;    facename = getFaceSelection $ --here is where i want it to return the number of selected poly's it's selected&lt;BR /&gt;    print facename&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migr-att-link" src="http://area.autodesk.com/userdata/forum/7/7856_jPv7UOnnIVFHsUOVtaTw.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2008 16:11:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008388#M27096</guid>
      <dc:creator>stigatle</dc:creator>
      <dc:date>2008-05-07T16:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008389#M27097</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;BR /&gt;So if i do this manualy it works.. but i want to script it. And i'm now stuck.&lt;BR /&gt;If i select the top\side polys with a angle of 30, then it select 1 face,&lt;BR /&gt;but when you select the inside (The hole) it selects 18 faces.&lt;BR /&gt;this is what i want to be able to detect..&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;The selection depends on the threshold you've set to 30. If you select one face in the hole, it selects all neighboring faces, because the angle threshold of 30 degrees is greater than the angle difference between 2 faces. In other words, the "by angle" option sets the maximum angle between neighboring polys to select. If you lower your threshold to 1 degree or even smaller, you should recognize that no longer 18 faces are selected.&lt;BR /&gt;&lt;BR /&gt;What you need to do is, reading the rotation angle of each faces' normal into an array and select those who have the exact threshold of 30. But I'm not sure if this needs to be done in world or local space.</description>
      <pubDate>Wed, 07 May 2008 17:02:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008389#M27097</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-07T17:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008390#M27098</link>
      <description>i know that, this is why i use the "face angle", because i want to select the inside polys all in "one go".&lt;BR /&gt;But what i need is to detect how many polys are selected when you select each face one by one with "select by angle = On".&lt;BR /&gt;So if it hits one that then will be 15+faces when "Select by angle" is on, then i know it's a hole.&lt;BR /&gt;and can then delete the 15+faces, cap the hole.</description>
      <pubDate>Wed, 07 May 2008 17:05:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008390#M27098</guid>
      <dc:creator>stigatle</dc:creator>
      <dc:date>2008-05-07T17:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008391#M27099</link>
      <description>Create a plane and convert it to editable poly.&lt;BR /&gt;In polygon subobject level check "By angle" and let the 45 value, &lt;BR /&gt;and now select any polygon in the plane: all the polys are selected&lt;BR /&gt;thanks to the By Angle checkbox.&lt;BR /&gt;&lt;BR /&gt;Now I need do the same in maxscript. I enter the angle with:&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;$.selectByAngle = on&lt;BR /&gt;$.selectAngle=45&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;and then I select any poly:&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;$.EditablePoly.SetSelection #Face #{11}&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;but only poly 11 is selected. So why is not working the&lt;BR /&gt;selectByAngle switch I turned on?</description>
      <pubDate>Thu, 08 May 2008 13:15:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008391#M27099</guid>
      <dc:creator>stigatle</dc:creator>
      <dc:date>2008-05-08T13:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008392#M27100</link>
      <description>Would you provide your scene, so the tests we're doing are depending on the same model!?</description>
      <pubDate>Thu, 08 May 2008 13:43:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008392#M27100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-08T13:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008393#M27101</link>
      <description>model attached as *.3ds.&lt;P&gt;&lt;A class="migr-att-link" href="http://area.autodesk.com/userdata/forum/7/7887_EWwNmKveVH06NWUxO5VM.zip" target="_blank"&gt;7887_EWwNmKveVH06NWUxO5VM.zip&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2008 13:45:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008393#M27101</guid>
      <dc:creator>stigatle</dc:creator>
      <dc:date>2008-05-08T13:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Poly - select by angle - getting the number of selected faces by angle</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008394#M27102</link>
      <description>if you select the face inside the hole, manually with "by angle" 30 then it selects the whole hole.&lt;BR /&gt;but not when you do it through script..&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;                thePoly = $&lt;BR /&gt;                select thePoly&lt;BR /&gt;                numFaces = (polyop.getNumFaces thePoly)&lt;BR /&gt;                for v = numFaces to 1 by -1 do&lt;BR /&gt;                (&lt;BR /&gt;                    thePoly.selectByAngle = on&lt;BR /&gt;                    thePoly.selectAngle = 30&lt;BR /&gt;                    --polyop.setFaceSelection  thepoly v&lt;BR /&gt;                    $.EditablePoly.SetSelection #Face #{v}&lt;BR /&gt;                    test = polyop.getFaceSelection thepoly&lt;BR /&gt;                    print test&lt;BR /&gt;                )&lt;BR /&gt;            )--end find holes in selected&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 May 2008 13:49:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/poly-select-by-angle-getting-the-number-of-selected-faces-by/m-p/4008394#M27102</guid>
      <dc:creator>stigatle</dc:creator>
      <dc:date>2008-05-08T13:49:14Z</dc:date>
    </item>
  </channel>
</rss>

