Script to remove all xrefs in the scene

Script to remove all xrefs in the scene

Anonymous
Not applicable
2,202 Views
4 Replies
Message 1 of 5

Script to remove all xrefs in the scene

Anonymous
Not applicable

Hello!

 

I'm new to maxscript and I've been looking everywhere to figure out how to simply delete or remove an xref scene using a macro but I haven't been able to figure it out. I have about a thousand trees that I'm turning into vray proxies and the xref scene has been deleted and now gives me a missing xref error when I load the scene. Anyone know how?

 

Thanks!

0 Likes
2,203 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor
xrefs.deleteAllXRefs()

see the maxscript help for details

 

Message 3 of 5

Anonymous
Not applicable

Great! This works perfect! I also figured out that 

 

xs = xrefs.getXRefFile 1
delete xs

 

works too 🙂

 

Now I'm trying to figure out how to replace a part of an object name with something else for example I want to replace elm_tree_07_PROXY-2018 with elm_tree_07_MAIN-2017.

 

Or cypress_tree_07_PROXY-2018 to elm_tree_07_MAIN-2017 etc...

 

I have hundreds of tree proxies files that have different name but I have to change all of them that have "PROXY-2018" to "MAIN-2017"

 

Any ideas? Sorry for being such a noob. I'm just beginning with maxscript.

0 Likes
Message 4 of 5

denisT.MaxDoctor
Advisor
Advisor

see substitutestring in the mxs help

Message 5 of 5

Anonymous
Not applicable

Thank you! I will check it out right now!

0 Likes