Hey Chris,
You should be able to do the same with custom attributes. There is no good (bug-free) way of creating them through SDK but I am dealing with them in ZK. Here's some code that I'm copying pasting from my project:
internal static IValue MaxScriptExecute( string str )
{
bool res = false;
IGlobal global = Plugin.Instance.Global;
//Plugin.Log( "Executing: " + str );
return global.ExecuteScript( global.StringStream.Create( str ), /*ref */res );
}
internal static ICustAttrib CreateCustomAttributes( IReferenceTarget destination )
{
const string variableName = "temporaryZookeeperVariable";
MaxScriptExecute( variableName + " = attributes CustomAttributes(parameters main rollout:params(param0 type:#float ui:param0 default:0) rollout params \"Parameters\"(spinner param0 \"Param 1\" type:#float))" );
MaxScriptExecuteWithReference( "custAttributes.add {reference} " + variableName, destination );
return MaxScriptExecuteWithReference( "custAttributes.get {reference} ( custAttributes.count {reference} )", destination ).ToReftarg as ICustAttrib;
}
MaxScriptExecuteWithReference(...) uses a custom plugin I implemented just for keeping references. You can substitute it with any other way of getting at your reftarget from maxscript (for example $.object to get from selection)
If this way doesn't work for you let me know and I'll look into MetaData class.
Marsel
Marsel Khadiyev (Software Developer, EPHERE Inc.)