create Assembly and add component

hello,

Today I create an assembly in my script (SldWorks.NewDocument) and then add a component to this assembly (AssemblyDoc.AddComponent5). But I found its kinda annoying that before I add a component into the assembly I must open it first (SldWorks.Opendoc). (am i wrong?)

Imagine that if i get a great number of components, during the automation, isn't kind of annoying that every part should be always opened before added into the assembly?

are there other methods to add component into assembly meanwhile no need to open it in the document?

BTW, since i'm a newbie in api, are there some topics (regarding to automation) in this forum recommanded?

any comments will be valuable.

Shane

SolidworksApi macros