how can I generate library from existing schematic in circuit studio?
Wow, no answer yet?
For what it is worth:
I can select the components I want on the schematic and then copy them and then paste into a schematic library. You can select multiple components at a time and copy and paste them. If I select the entire schematic I can copy and paste into a new library. The parts seem to be generated without error and any selected nets don't seem to bother the process.
Duplicated instances of parts will generate multiple components in the library. So you would need to weed through duplicates. This is actually probably safer than it trying to figure out what is and isn't truly a duplicate. For example, you may have duplicate resistors but you changed the component properties.
CS has no ability to filter selections like AD does (with find similar components and masks). That is a missing productivity feature they really should add to CS.
Something to be aware of if copying from an existing schematic or PCB. If the original components were from the Altium Vault then you cannot successfully copy and edit them, the software will revert back to using the vault component and ultimately ignore any changes you try to make. If the components were from other sources then you should be able to copy and also modify as needed.
Did you know there are a huge number of component libraries available from the Altium design center? These can be downloaded, installed locally and then selected parts copied to local libraries and edited should you wish.