Demo entry 6360678

test

   

Submitted by anonymous on May 02, 2017 at 15:15
Language: Python. Code size: 471 Bytes.

import pyxb
import VTSProject

xml = open("CubeSat.vts").read()
project = VTSProject.CreateFromDocument(xml)

project.General.StartDateTime = VTSProject.MJDDateTimeType("55277 81261.150400")

for i in range(0,100):
    sat = VTSProject.SatelliteType()
    sat.Name = "sat_" + str(i)
    sat.ParentPath = "Sol/Earth"
    project.Entities.Satellite.append(sat)

f = open('test.xml', 'w')
pyxb.RequireValidWhenGenerating(True)
f.write(project.toxml("utf-8"))

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).