Error Checking vs existing xref
Sorry for having to ask for help on such a simple script, but I'm really at my wits end.. 3 hours later, and I can't get this to work.. I'm trying to check to make sure that I'm not adding an xref to a scene that might already exist in the scene.. but I get nothing but errors that I can not figure out.. if you look in the Fn LoadXref you'll see my attempts at checking my new files vs existing xrefs.. but I can't seem to make it work.. the commented out code is what I want to happen once I verify that the file is not a duplicate, and it and the rest of the script work fine.. Any suggestions I'd greatly appreciate.
YS
Attachment | Size |
---|---|
load_xrefs.ms | 4.65 KB |
Comments
glad to help
Declare the variables as locals is just good scripting practice that will helps you in more complex scripts.
The LoadXref function you can define where you want, but the Resize function call your rollout and its elements, so - you can do 2 things: 1) if you like to put this function out of the rollout, then be sure its defined after the rollout, and 2) if you like to define this function out and before the rollout def, then supply access to the rollout via variable argument, i.e. something like:
cheers
my recent MAXScripts RSS (archive here)
try this
my recent MAXScripts RSS (archive here)
Thanks
Hey thanks a lot, that worked great. As to the line you commented out, it causes the loaded xref to be disabled initially when loaded.
Out of curiosity, do you know why the two functions I define in the script can't be declared outside the rollout? I started the script with a ( so anything beyond that should be local to the script, but every time I try to move them out of the rollout itself suddenly they stop working.
Also you explicitly defined MatchFound as local.. Is there a need to do that, or is that just good scripting practice?
Thanks again for your assistance.
Yancy