MaxStudio Posted February 12, 2013 Share Posted February 12, 2013 Im creating a set of objects with the same plugin. The plugin has a user defined string parameter. Lets say the string parameter is "name" I create object1 and set the name parameter to "Red" I create object2 and attempt to set the name parameter to "Red". I would like it to alert me that "Red" is already in use, give me the option to set it to something else, or allow me to override and continue to use "Red". Is this possible? Quote Link to comment
JBenghiat Posted February 12, 2013 Share Posted February 12, 2013 (edited) Yes this is possible. There are several thing to consider. - This functionality should be created via the PIO, and doesn't need to involve a worksheet. - Do your check when IsNewCustomObject is TRUE. This will only be true when you are manually inserting a PIO for the first time. That will make sure the check doesn't happen on a regular regen and that you will only check and warn one object at a time. - Use Count() to see if any other objects have the name field as the same - Keep paramater and variable values separate. For example, start by setting obName:=PName to set your name variable to the parameter. If you need to change the name parameter, use SetRField(). The parameter won't update until another regen, so make sure to update and refer to obName for the rest of the script. Hopefully, this will give you a start. -Josh Edited February 12, 2013 by JBenghiat Quote Link to comment
MaxStudio Posted February 13, 2013 Author Share Posted February 13, 2013 Thanks Josh, I'll play around with it. I appreciate the direction. Derek Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.