The objXRefs Core Interface provides MAXScript access to the XRef Object feature.
Note: The objXRefMgr interface is the preferred way for working with xrefs in 3ds Max 8 and higher.
Methods:
<maxObject>objXRefs.addNewXRefObject <filename>fname <string>objname <integer>flags
The merge behavior is controlled by the bits set in the flags parameter:
Duplicate material names action:
256 - Prompt (Bit: 9)
512 - Use Scene Material (Bit: 10)
1024 - Use Merged Material (Bit: 11)
2048 - Merge material and automatically rename them (Bit: 12)
Reparent action: (available in 3ds Max 2019.1 Update and higher)
4096 - Prompt (Bit: 13)
8192 - Always Reparent (Bit: 14)
16384 - Never Reparent (Bit: 15)
The default behavior (flags = 0) is :
<integer>objXRefs.getNumXRefObjects <filename>fname
Returns the number of object XRefs contained in the file
<maxObject>objXRefs.getXRefObject <filename>fname <index>index
Returns the Nth XRef'ed object contained in the specified file
<integer>objXRefs.getNumFiles()
Returns the number of files that contain object XRefs
<filename>objXRefs.getFileName <index>index
Returns the file name of the Nth file that contains object XRefs
<boolean>objXRefs.reloadFile <filename>fname
Returns true if successful and false otherwise.
<boolean>objXRefs.isFileUnresolved <filename>fname
Returns true if successful and false otherwise.
<boolean>objXRefs.isFileDisabled <filename>fname
Returns true if successful and false otherwise.
<array>objXRefs.getAllXRefObjects()
Returns an array of all XRef Objects present in the current scene.
<integer>objXRefs.getEmptyXRefRecCount()
Returns the number of empty XRefs.
Available in 3ds Max 8 and higher.