<?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 Re: Select Objects using Custom Attributes? in 3ds Max Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8015264#M43969</link>
    <description>&lt;P&gt;Sorry about several edits, I was editing in-place and misread original request. Current iteration above should now get you where you want to be.&lt;/P&gt;</description>
    <pubDate>Mon, 21 May 2018 13:22:43 GMT</pubDate>
    <dc:creator>lightcube</dc:creator>
    <dc:date>2018-05-21T13:22:43Z</dc:date>
    <item>
      <title>Select Objects using Custom Attributes?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/7990767#M43965</link>
      <description>&lt;P&gt;I am working with models exported from S3D to an FBX format. The original object names have been replaced with Object_22222 but the custom attributes are visible. I need to select objects by type (ie, equipment) and group them so I can apply the appropriate material.&lt;/P&gt;&lt;P&gt;Here is a sample of the attributes I would like to access.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3DSMax_customattribute001.JPG" style="width: 180px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/498497i4ACFB96EC00B8A05/image-size/large?v=v2&amp;amp;px=999" role="button" title="3DSMax_customattribute001.JPG" alt="3DSMax_customattribute001.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;There are a few hundred objects that use the attribute "Equip Name" and the name is unique to each so I think I will need to identify objects based on the attribute and not the actual name.&lt;/P&gt;&lt;P&gt;Is it possible to select objects using the custom attribute?&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 17:17:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/7990767#M43965</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-09T17:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects using Custom Attributes?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/7993148#M43966</link>
      <description>&lt;P&gt;Just a thought -- perhaps you can access the custom attributes from maxScript and rename the objects that way?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_0A1E08F8_A8C5_4737_AA6F_39194AD16559_htm" target="_blank"&gt;https://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_0A1E08F8_A8C5_4737_AA6F_39194AD16559_htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 15:42:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/7993148#M43966</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2018-05-10T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects using Custom Attributes?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8011799#M43967</link>
      <description>&lt;P&gt;thx Jeff&lt;/P&gt;&lt;P&gt;I will try that. As with most projects, the deadline is crazy and I've had to go back to the CAD group to get the model in another format.&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 15:53:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8011799#M43967</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-18T15:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects using Custom Attributes?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8015233#M43968</link>
      <description>&lt;P&gt;The method is fairly simple if you do a little MAXScript. Here is a way to accomplish this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Click F11 to open the MAXScript Listener.&lt;/LI&gt;
&lt;LI&gt;Click the MacroRecorder button and make sure&amp;nbsp;the Enabled option is on.&lt;/LI&gt;
&lt;LI&gt;Select one of your objects with the custom attribute and type an extra character into the field. Take note of the line that appears in the macro recorder section (pink background). You will see something like $.baseObject.&lt;STRONG&gt;&lt;FONT color="#008000"&gt;caName&lt;/FONT&gt;.&lt;FONT color="#0000ff"&gt;propName&lt;/FONT&gt;&lt;/STRONG&gt; = "thenameX". (The caName portion represents the name of the customattribute definition and the propName represents the actual property name. You will use these values below.)&lt;/LI&gt;
&lt;LI&gt;Revert the value of your object.&lt;/LI&gt;
&lt;LI&gt;Click Scripting &amp;gt; Max Script Editor.&lt;/LI&gt;
&lt;LI&gt;Click File &amp;gt; New.&lt;/LI&gt;
&lt;LI&gt;Paste&amp;nbsp;the MAXScript code from below and swap the caName / propName for the ones you recorded above.&lt;/LI&gt;
&lt;LI&gt;Click Tools &amp;gt; Evaluate All (CTR+E).&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;--Select Objects with CA property equalling a value
select (for obj in objects where isProperty obj #caName AND isProperty obj.caName #propName AND obj.caName.propName == "thename" collect obj)&lt;/PRE&gt;
&lt;P&gt;That will select the objects. Verify that the results. If they are the correct objects, you can repeat steps above with the code below--again swapping the caName and propName with those of your custom attributes. Presuming that the material you want is the current material in the material editor (Slate here)&lt;/P&gt;
&lt;PRE&gt;--Give Material to objects with a CA value
theMat = (sme.GetMtlInParamEditor())
if superclassof theMat == Material then (
	for obj in objects where isProperty obj #caName AND isProperty obj.caName #propName AND obj.caName.propName == "thename" do (
		obj.mat = theMat
	)
)
&lt;/PRE&gt;
&lt;P&gt;If you do this a lot and on different values, it would be best to build a little UI with rollouts. But that's for another day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 13:21:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8015233#M43968</guid>
      <dc:creator>lightcube</dc:creator>
      <dc:date>2018-05-21T13:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects using Custom Attributes?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8015264#M43969</link>
      <description>&lt;P&gt;Sorry about several edits, I was editing in-place and misread original request. Current iteration above should now get you where you want to be.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 13:22:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/select-objects-using-custom-attributes/m-p/8015264#M43969</guid>
      <dc:creator>lightcube</dc:creator>
      <dc:date>2018-05-21T13:22:43Z</dc:date>
    </item>
  </channel>
</rss>

