Skip to content

Instantly share code, notes, and snippets.

@pvandervelde
Last active August 29, 2015 13:56
Show Gist options
  • Save pvandervelde/8995251 to your computer and use it in GitHub Desktop.
Save pvandervelde/8995251 to your computer and use it in GitHub Desktop.
import clr
clr.AddReference("Apollo.Core.Scripting")
import sys
import Apollo.Core.Scripting
# Verify that we don't have an active project
hasactiveproject = projects.HasActiveProject()
if hasactiveproject:
print 'Fail: Active project already exists'
sys.exit(1)
# Create a project
try:
projects.NewProject()
except Exception, e:
print 'Fail: Could not create new project'
sys.exit(1)
# Verify that the project was created
newproject = projects.ActiveProject()
if newproject is None:
print 'Fail: No new project was created'
sys.exit(1)
else:
print 'Pass: New project created successfully'
# verify that we can set the name
newname = 'project_newname'
newproject.Name = newname
if newproject.Name != newname:
print 'Fail: Project name was not updated'
sys.exit(1)
else:
print 'Pass: Project name updated successfully'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment