Hii....
Ok its me prem who posted the question found the script in a way Please check out and say..
--Created by Prem Anand A on 14, September 2006 (Version 01)
--button Remove All Instance removes all the instance in the scene no need to select any
global objNode
global varname
global objNode1
global varname1
rollout unique "Make Object Unique" width:240 height:140
(
pickbutton Target1 "Base_Object" pos:[6,12] width:110 height:30
pickbutton Target2 "Pick_Target" pos:[122,12] width:110 height:30
button Remove_Instance "Remove_Instance" pos:[122,60] width:115 height:30
button RemoveAll_Instance "RemoveAll_Instance" pos:[62,100] width:115 height:30
button Add_Instance "Add_Instance" pos:[6,60] width:110 height:30
on Target2 picked target do
(
-- store target name
Target2.text = target.name
varname1=(Target2.text)
print varname1
-- as target name is string u need to convert it into variable-------by getnodeby name-----
objNode1=(getNodeByName varname1 exact:true)
print objNode1;
)
on Target1 picked target do
(
-- store target name
Target1.text = target.name
varname=(Target1.text)
print varname
-- as target name is string u need to convert it into variable-------by getnodeby name-----
objNode=(getNodeByName varname exact:true)
print objNode;
)
on Remove_Instance pressed do
(
maxOps.CollapseNodeTo objNode1 1 on--removes the modifier
InstanceMgr.GetInstances objNode1 &instances-- gets the number of instance for the object
InstanceMgr.MakeObjectsUnique &instances #prompt---removes all the instances of the base object
)
on RemoveAll\_Instance pressed do
(
max select all;
array1=getCurrentSelection();
(
for j=1 to array1.count do
(
objNode=array1[j];
maxOps.CollapseNodeTo objNode 1 on--removes the modifier
InstanceMgr.GetInstances objNode &instances-- gets the number of instance for the scene
InstanceMgr.MakeObjectsUnique &instances #prompt---removes all the instances in the scene
)
)
)
on Add\_Instance pressed do
(
instanceReplace (objNode1) (objNode)--makes the object as an instance of the base
)
)
createDialog unique 240 140