<?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 instancereplace in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7732536#M11221</link>
    <description>&lt;P&gt;I'm pretty newbie about maxscript.&lt;BR /&gt;In maxscript ,there is instancereplace method.&lt;BR /&gt;So,I want to change to make rollout button and select objects by pushing the bottun.&lt;BR /&gt;I tried ,but don't work well.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;rollout MYTool01 "instancereplace"&lt;BR /&gt;(&amp;nbsp;&lt;BR /&gt;button selectObj_btn&amp;nbsp; "selectObj" pos:[8,5] width:60&lt;BR /&gt;button replaceObj_btn "replaceoObj" pos:[8,30] width:60&lt;BR /&gt;button replace_btn "execute" pos:[8,50] width:60&lt;/P&gt;&lt;P&gt;local obj=#()&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;on selectObj_btn pressed do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;srcobj= $selection as array&lt;BR /&gt;&amp;nbsp;)&amp;nbsp;&lt;BR /&gt;&amp;nbsp;on&amp;nbsp; replaceObj_btn pressed do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;dstObj = $selection as array&lt;BR /&gt;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;on replace_btn pressed do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;instancereplace srcobj dstObj&lt;BR /&gt;&amp;nbsp;&amp;nbsp;)&lt;BR /&gt;)&lt;BR /&gt;createDialog&amp;nbsp; MYTool01 width:600&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is there a way to find a good code,please?&lt;BR /&gt;Sorry about my poor English.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2018 16:09:49 GMT</pubDate>
    <dc:creator>akaijin</dc:creator>
    <dc:date>2018-01-29T16:09:49Z</dc:date>
    <item>
      <title>instancereplace</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7732536#M11221</link>
      <description>&lt;P&gt;I'm pretty newbie about maxscript.&lt;BR /&gt;In maxscript ,there is instancereplace method.&lt;BR /&gt;So,I want to change to make rollout button and select objects by pushing the bottun.&lt;BR /&gt;I tried ,but don't work well.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;rollout MYTool01 "instancereplace"&lt;BR /&gt;(&amp;nbsp;&lt;BR /&gt;button selectObj_btn&amp;nbsp; "selectObj" pos:[8,5] width:60&lt;BR /&gt;button replaceObj_btn "replaceoObj" pos:[8,30] width:60&lt;BR /&gt;button replace_btn "execute" pos:[8,50] width:60&lt;/P&gt;&lt;P&gt;local obj=#()&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;on selectObj_btn pressed do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;srcobj= $selection as array&lt;BR /&gt;&amp;nbsp;)&amp;nbsp;&lt;BR /&gt;&amp;nbsp;on&amp;nbsp; replaceObj_btn pressed do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;dstObj = $selection as array&lt;BR /&gt;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;on replace_btn pressed do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;instancereplace srcobj dstObj&lt;BR /&gt;&amp;nbsp;&amp;nbsp;)&lt;BR /&gt;)&lt;BR /&gt;createDialog&amp;nbsp; MYTool01 width:600&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is there a way to find a good code,please?&lt;BR /&gt;Sorry about my poor English.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 16:09:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7732536#M11221</guid>
      <dc:creator>akaijin</dc:creator>
      <dc:date>2018-01-29T16:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: instancereplace</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7733170#M11222</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(
	global rol_MYTool01
	try(destroyDialog rol_MYTool01)catch()
	rollout rol_MYTool01 "instancereplace"
	( 
		local selObj = undefined
		local objsToReplaceArr = #()
		
		button selectObj_btn  "Select source object" width:140
		button replaceObj_btn "Select objects to replace"  width:140
		button replace_btn "EXECUTE"  width:140

		on selectObj_btn pressed do
		(
			selObj = selection[1]
		) 
		on replaceObj_btn pressed do
		(
			objsToReplaceArr = selection as array
		)
		on replace_btn pressed do
		(
			if selObj != undefined and objsToReplaceArr.count != 0 do
			(
				instanceReplace objsToReplaceArr selObj 
			)
		)
	)
	createDialog  rol_MYTool01 
)&lt;/PRE&gt;&lt;P&gt;Select only one Source object and press the [Select source object] button.&lt;/P&gt;&lt;P&gt;Then select the objects that you want to be replaced and press the [Select objects to replace] button.&lt;/P&gt;&lt;P&gt;Then press the [EXECUTE] button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 19:05:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7733170#M11222</guid>
      <dc:creator>miauuuu</dc:creator>
      <dc:date>2018-01-29T19:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: instancereplace</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7733453#M11223</link>
      <description>&lt;P&gt;here is my version:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pick a "target" object as an object for replace with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select source nodes and apply "Instance Replace"&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;try(destroydialog instancereplaceDialog) catch()
rollout instancereplaceDialog "Instance Replace" width:210  
(
	group "Target:" 
	(
		pickbutton target_bt "Pick Target" width:192 autoDisplay:on align:#right offset:[4,0]
	)
	group "Tools:" 
	(
		button replace_bt "Instance Replace" width:192 align:#right offset:[4,0]
	)
	
	on replace_bt pressed do undo "Replace" on 
	(
		if isvalidobj target_bt.object and selection.count &amp;gt; 0 do
		(
			instancereplace selection target_bt.object
		)
	)
)
createdialog instancereplaceDialog&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jan 2018 20:47:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7733453#M11223</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2018-01-29T20:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: instancereplace</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7736721#M11224</link>
      <description>&lt;P&gt;Hi,miauuuu and denisT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;I can stop worrying about that now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These scripts works well for group objects !&lt;/P&gt;&lt;P&gt;I'll keep on trying, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 15:55:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/instancereplace/m-p/7736721#M11224</guid>
      <dc:creator>akaijin</dc:creator>
      <dc:date>2018-01-30T15:55:31Z</dc:date>
    </item>
  </channel>
</rss>

