<?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 saving an X-Ref in custom parameters in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/saving-an-x-ref-in-custom-parameters/m-p/6028645#M14792</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create an X-Ref Dummy. It should be able to load, update/reload and delete the XRef that will automaticalle be linked to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its hard however to know what the XRef is once you created it. The Dummy does not have it as a children object and finding the right one iterating through the xref list is verry cheesy since you can load one max file as Xref multiple times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I thought it should be possible to simply store the XRef in the custom parameters in the Dummy (as with manny other parameters) but this seems to be a bit complicated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I came up with this so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;THE_EVE_X_REF=attributes EVE_X_REF(
	parameters X_REF_Settings rollout:X_REF_Roll(
		--other params
		
		the_Xref_Scene type:#filename assettype:#XRef enumAsAsset:true
		--other params
	)
	rollout X_REF_Roll "X-Ref Dummy"(

... bla bla

fn load_xref a_path=(
	if a_path != undefined and (doesfileexist a_path) then(
		new_Xref = xrefs.addNewXRefFile a_path
		new_Xref.parent = get_Master_Dummy()
		(get_Master_Dummy()).baseObject.EVE_X_REF.the_Dummy_name = new_Xref
	)
)&lt;BR /&gt;&lt;BR /&gt;The compiler says that it can not assign an Xref-File to the String filename&lt;BR /&gt;so my problem really is making an apropiate space for an xref in the parameters but I do not know how to do that.&lt;BR /&gt;can someone please help me?&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2016 10:30:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-08T10:30:25Z</dc:date>
    <item>
      <title>saving an X-Ref in custom parameters</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/saving-an-x-ref-in-custom-parameters/m-p/6028645#M14792</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create an X-Ref Dummy. It should be able to load, update/reload and delete the XRef that will automaticalle be linked to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its hard however to know what the XRef is once you created it. The Dummy does not have it as a children object and finding the right one iterating through the xref list is verry cheesy since you can load one max file as Xref multiple times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I thought it should be possible to simply store the XRef in the custom parameters in the Dummy (as with manny other parameters) but this seems to be a bit complicated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I came up with this so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;THE_EVE_X_REF=attributes EVE_X_REF(
	parameters X_REF_Settings rollout:X_REF_Roll(
		--other params
		
		the_Xref_Scene type:#filename assettype:#XRef enumAsAsset:true
		--other params
	)
	rollout X_REF_Roll "X-Ref Dummy"(

... bla bla

fn load_xref a_path=(
	if a_path != undefined and (doesfileexist a_path) then(
		new_Xref = xrefs.addNewXRefFile a_path
		new_Xref.parent = get_Master_Dummy()
		(get_Master_Dummy()).baseObject.EVE_X_REF.the_Dummy_name = new_Xref
	)
)&lt;BR /&gt;&lt;BR /&gt;The compiler says that it can not assign an Xref-File to the String filename&lt;BR /&gt;so my problem really is making an apropiate space for an xref in the parameters but I do not know how to do that.&lt;BR /&gt;can someone please help me?&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 10:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/saving-an-x-ref-in-custom-parameters/m-p/6028645#M14792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T10:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: saving an X-Ref in custom parameters</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/saving-an-x-ref-in-custom-parameters/m-p/6028735#M14793</link>
      <description>&lt;P&gt;of course this should be (get_Master_Dummy()).baseObject.EVE_X_REF.the_Xref_Scene = new_Xref&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;still, there is the same error &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 11:23:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/saving-an-x-ref-in-custom-parameters/m-p/6028735#M14793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T11:23:32Z</dc:date>
    </item>
  </channel>
</rss>

