euclid, I don't know if this is of any use or interest to you (or anyone else for that matter) but I noticed a script library on the German forum the other day which seems to be specifically for working with complexes. The part which caught my eye was that it apparently has a component which determines what factories a complex is composed of.
Note that I don't understand German, so I may be completely mistaken, though the part about determining the factories was in English in the subject.
Link is here
Just noticed that it's by X-Freak Cartman when I went to get the link.
[SCRIPT] Complex production cost V3.0 (3-12-06)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators