How to write Solidworks API for Automation?