save XYZ coordinates in text file

Hi friends , I have XYZ coordinates that I want to save them in TXT file . are  there a api code to do this ! thnak you

SolidworksApi macros