Notifications
Clear all

[Closed] how to select the imported objects after import ?

Hi guys,

I am pretty sure it’s a simple matter but I couldn’t figure it out so here I am asking for help!!
I am importing some autocad files and I would be able to select the objects imported and attach them together before I go to the next file. I couldn’t figure out how to select the objects imported without affecting the rest of the scene! When merging files you have the option #select to select your merged object but import doesn’t have it…

Any help would be greatly appreciated!

Thanks,
Anton

3 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

The obviousl hack would be to collect ALL objects BEFORE the import in an array.
After the import, any object not in that array is a new one.

For example,

oldObj = objects as array
--do import here
select oldObj 
max select invert --at this point, newly imported objects should be selected
newObj = selection as array
max select none

Of course, you could iterate through the objects in the scene and process the arrays without using selection in the viewports. Not sure which method would be faster though…
I assume the second would be faster with lots of objects.


oldObj = objects as array
 --perform import here
newObj = for o in objects where findItem oldObj o == 0 collect o

when merging and importing, the new objects should be selected by default? Or are you doing mergin/importing via maxscript?

Gibbz, I’m doing it via maxscript and they are not selected after the import.

Thanks Bobo, I was thinking about something like that but hoping it would be a direct way. I will try them both see which would be faster.