You'll need to use either arrays or type objects.
That will loop through every entity you have created in that type and save them to the text file. Obviously not the correct syntax used, but you get my drift :o)
Type Machine_Part Field name$ Field entity End Type m.machine_part = new machine_part m\name$ = "Gage1" m\entity = createsphere() ; just for example m\name$ = "Gage2" m\entity = createsphere() ; just for example m\name$ = "Part1" m\entity = createsphere() ; just for example m\name$ = "Part2" m\entity = createsphere() ; just for example Open "C:\Temp\capture.txt" for output as #1 For m.machine_part = Each machine_part Print #1,EntityX(m\entity)& "," & EntityY(m\entity) & "," & EntityZ(m\entity) Next
That will loop through every entity you have created in that type and save them to the text file. Obviously not the correct syntax used, but you get my drift :o)