PDA

View Full Version : a file with nested xref files in it


HuaMuLan
03-19-2009, 04:50 PM
A file with xref files in it, and the xref files may xref other files too .
How can we merged all the nested files together into one file ?

HuaMuLan
03-20-2009, 03:11 AM
I've find the answer . just to chech the number of Xrefs .And use it as the loop threhold

floopyb
03-20-2009, 06:11 AM
You will need to make a recursive function to be called untill the number of xrefscenes is 0 like so:

fn MergeAllXrefScenes =
(
for i = xrefs.getXRefFileCount() to 1 by -1 do merge (xrefs.getXRefFile i)
if xrefs.getXRefFileCount() != 0 then MergeAllXrefScenes()
)


MergeAllXrefScenes()

HuaMuLan
03-20-2009, 08:13 AM
my approch

while xrefs.getXRefFileCount() > 0 do
(
xrefShell = xrefs.getXRefFile 1
merge xrefShell
)

any comment is really appreciated.

HuaMuLan
03-20-2009, 08:20 AM
Personally , I like your idear , floopyb . It seems more reasonable .

floopyb
03-20-2009, 08:52 AM
You idea is quite elegant, saves defining a function!

HuaMuLan
03-20-2009, 09:27 AM
It's My Way:P

CGTalk Moderation
03-20-2009, 09:27 AM
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.