[Closed] select all by name
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:
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.
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:
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
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:
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!
Please enter a name to continue."
else
(
NameNotExisting = false
clearSelection()
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!
Enter a valid name and try again."
)
)
)
createdialog SelByName 330 55
Hope it helps!
Thanks
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: