View Full Version : select all by name

11 November 2005, 06:29 PM
Is there a script command that can select all objects by the same name.
I have opened my listener up while selecting groups, this is no help.
I have alot of parts called "spacers" and alot of other parts also like "posts".
I would like to create a rollout that will select certain objects group and UVW map them.
This would make my life abit easier.

Any help would be great

BTW Im working in VIZ 4.0

MaxScript Newb:blush:

11 November 2005, 09:06 PM
Have you tried the "Select by name"? You can enter your search at the top and it will select the objects with that search pattern. You can also use in your search the * character to truncate prefixes or suffixes or to look for parts of the name. I am using it all the time for selections and I never felt the need for a script to replace or improve it. In my opinion, a script just will add more mouse clicks to the operation...

If you still need it, I will write one for you tonight.

11 November 2005, 01:59 PM
Thanks alot for your reply.
I just hope I'm explaining what I'm trying to get.
Its just that my scenes are imports of Inventor assembly files that have on average 3000 parts.

If you can wip up a quick script that would rock.:buttrock:

11 November 2005, 02:34 PM
Instead of opening the "Select by Name" dialog you can use this single line of script (enter in the Listener, and press Enter on the numeric keypad)

select $'Box*'
Selects all objects which names start with Box

select $'*Test*'
Selects all objects which names contain Test

select $'Box0?'
Selects all objects which names start with Box and end with any single character

A very annoying feature of the Select by Name dialog is that it updates the list after each keystroke, instead of when tabbing out or pressing enter. This is cool with 10 objects in your scene, but with 1000+ objects it's pretty annoying.

- Martijn

11 November 2005, 03:52 PM
Thanks alot Martijn I have noticed the flickering when a select about 200-400 objects.
The trick I'm having now is selecting all the parts within an asy. and grouping them.
rollout SelectGroup "Select and Group"
button select1 "Select Small Pieces"
button select2 "Select Floor"
button select3 "Select Crowns"
button select4 "Select Base"

on select1 pressed do

select $'*Post Above*'
max group group
select $'*Post*'
max group attach
max tool hlist
select $'*crown*'
max group attach
max tool hlist
select $'*Spacer Bar*'
max group attach
max tool hlist


createDialog SelectGroup width:250

please forgive my newb code. :argh:

11 November 2005, 08:56 PM
Here is what I have:

rollout SelByName "Select Objects By Name"
edittext NameTxt "Enter Object's Name:" fieldWidth:200 bold:true
button SelButton "Select Objects" height:22 width:305

on SelButton pressed do
if NameTxt.text == "" then messagebox "No name entered! \nPlease enter a name to continue."
NameNotExisting = false
for o=1 to Objects.count do
if findstring objects[o].name (NameTxt.text) != undefined do
NameNotExisting = true
selectmore objects[o]
if objects[o].isHidden == true or objects[o].isFrozen == true or (isGroupMember objects[o] == true) do deselectNode objects[o]
if NameNotExisting == false do messagebox "There are no objects in scene with the specified name! \nEnter a valid name and try again."
createdialog SelByName 330 55

Hope it helps!

11 November 2005, 03:35 PM
First I'd like to say thanks so much for the help.
Here a little farther detail on what im trying to acheive.
I have alot of small pieces in my scene that will get a wood texture without grain, just like a flat wood color.
I'd like to select a known bunch of objects, group them and apply UVW map.
Same with medium and large size known objects that will later get a wood grain.

Rough example script "select obj1,obj2,obj3,obj4,obj5,obj6,1obj7 Group name1 Apply UVW.

Thank you guys/girls ALOT:thumbsup:

CGTalk Moderation
11 November 2005, 03:35 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.