this is an example for modeling truss using sap2000 API
the excel sheet also get the results after analysis is completed
hope it will be useful
here you will find the excel sheets
non linear truss
https://www.mediafire.com/folder/wcpsa573r3r6n/design_programs