trace instance objects

trace instance objects

Anonymous
Not applicable
477 Views
2 Replies
Message 1 of 3

trace instance objects

Anonymous
Not applicable
I have a large model with allot of models
i want to export these in seperat files with a script

but i would like to export all instanced objects seperat becaus my other software pakket can use instance objects in a more efficient way

is there a way to trace all instaces of one type of object en then select them all for export??
0 Likes
478 Views
2 Replies
Replies (2)
Message 2 of 3

mertens3d
Enthusiast
Enthusiast
-- i got this code a while back from blur (or at least part of it)
--- from blur
fn get_instances myinput =
(
instances_array = #()
if (refs.dependents myinput.baseobject).count != 0 then
(
for w = 1 to (refs.dependents myinput.baseobject).count do
(
-- if (refs.dependents myinput.baseobject) != myinput then
-- (
if iskindof (refs.dependents myinput.baseobject) (classof myinput) then
(
append instances_array (refs.dependents myinput.baseobject)
)
)
-- )
)
return instances_array
)

-------------------------------



select (get_instances($))

0 Likes
Message 3 of 3

Anonymous
Not applicable
as far as i understood u want to select the instanced object and export all the object into a single file then the above code works perfectly fine and u can try this too..
fn selectinst ob =(
instances = #()
InstanceMgr.GetInstances ob &instances
return instances
)

select (selectinst($))
0 Likes