Request for script to create layers from object base name
I'm in need of a script that could create layers based on names of CAD objects imported into Max, Max brings the CAD geometry and names it based on on its CAD layer, however when adding multiple of the same, it add a numeric sequence to those object.
Example: 3 objects of the same CAD objects.
Max Imported Object names:
AFUPA-3D-TL-GL.001, AFUPA-3D-TL-GL.002, AFUPA-3D-TL-GL.003
I would like to have a script to create a single layer named "AFUPA-3D-TL-GL" fo that sequence of objects and move all those objects to that layer and do the same for the next.
I found a script that is pretty close, but creates a layer for each individual object instead. I have attached the script if someone could help me modify it you would be a life saver! :)