-- Count the number of UI items found in the definition from the Cat_GetDef() funtion, Then build a UI Items list , Cat_UIItems_Array and CAT_Paramblock array
-- When building the new array, it excludes the ui item that corrispondes to the listbox item that was selected for delection.
-- CAT_UI_Array is a string array for the delete listbox.
-- CAT_NewAttrib is the source for defdata, CAT_NewAttrib[1] is the paramblock array, CAT_NewAttrib[2] is the UI items associated with the paramblock. This is what is associated
-- in the the defdata of the object.
--
-- Once the item is deleted, A new CAT_NewAttrib is made and the array are stuffed into CAT_NewAttrib[1] and CAT_NewAttrib[2]
-- The Current definition is then set back to the current definition, "CAT_CurrentDef.Defdata = CAT_NewAttrib"
-- CAT_CurrentDef is the current custom attribute and is retrieved whenever CAT_GetDef() is called on the selected object.
if Querybox "This Will Delete ALL Custom Attributes \n On The Selected Object \n Continue?" Title:"Custom Attributes" then
(
/* Localize Off */
Case CAT_DoneRoll.CAT_AddTo.selection of
(
1:(if getCommandPanelTaskMode() != #Create Then Max Create Mode; Undo "Delete All CAs" On (CustAttributes.Delete Selection[1].BaseObject CAT_CurrentDef))
2:(Undo "Delete All CAs" On (CustAttributes.Delete Selection[1].modifiers[CAT_ModIndex] CAT_CurrentDef))
3:(if getCommandPanelTaskMode() != #Create Then Max Create Mode; Undo "Delete All CAs" On (CustAttributes.Delete Selection[1].material CAT_CurrentDef))
)
if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
If Debug == True then Format "%\n" ("------------------------------------------------------------- \n -- Add UI Performed.. \n-------------------------------------------------------------")
If Debug == True then Format "%\n" ("------------------------------------------------------------- \n -- Set Definition Performed.. \n -------------------------------------------------------------")
if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
If Debug == True then Format "%\n" ("------------------------------------------------------------- \n -- Get Definition Performed.. \n -------------------------------------------------------------")
if getCommandPanelTaskMode() != #Modify Then Max Modify Mode
-- CAT_NewAttrib is the source for defdata, CAT_NewAttrib[1] is the paramblock array, CAT_NewAttrib[2] is the UI items associated with the paramblock. This is what is associated
-- in the the defdata of the object.
--
-- Once the item is deleted, A new CAT_NewAttrib is made and the array are stuffed into CAT_NewAttrib[1] and CAT_NewAttrib[2]
-- The Current definition is then set back to the current definition, "CAT_CurrentDef.Defdata = CAT_NewAttrib"
-- CAT_CurrentDef is the current custom attribute and is retrieved whenever CAT_GetDef() is called on the selected object.