Being that you have a very ambiguous, large scope question, its no surprise your getting no responses. So here is a response, good bad or indifferent. To add a component to an assembly using iLogic code, you must:
get reference to the assembly:
dim asmDoc as AssemblyDocument = ThisApplication.ActiveDocument
that assumes the necessary assembly is the active document you can also use ThisDocument (they mean the same thing).
Then get the assembly definition
dim asmCompDef as AssemblyComponentDefinition = asmDoc.ComponentDefinition
This is where the occurrences for the parts and sub assemblies are found, you could loop through the existing list by using asmCompDef.Occurrences. Use that object to verify existing file modeling data, as well as add parts and sub assemblies.
dim compOccs as ComponentOccurrences = asmCompDef.Occurrences
And finally, add parts and sub assemblies using these commands
compOccs.Add
compOccs.AddByComponentDefinition
compOccs.AddCustomiPartMember
compOccs.AddiAssemblyMember
compOccs.AddiPartMember
compOccs.AddUsingiMates
compOccs.AddVirtual
compOccs.AddWithOptions
To know what these mean in detail, I suggest you crack open the API help documentation, and search the index for the above names.
Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/