How to create an object inside of my project via Python?
Category:
Scripting
Answer
To create some objects (in your case object of the class IntCase) you should use CreateObject() method.
object.CreateObject (string ClassName [, string NameOfTheNewCreatedObject])
Creates a new object of class 'ClassName' in the target object. The target object must be able to receive an object of the given class. A fatal error will occur when this is not the case, causing the running ComPython command to exit. For more information refer to our Python technical references.
In the following example we will create study case object:
import powerfactory
app=powerfactory.GetApplication()
proj=app.GetProjectFolder('study')
StudyCase=proj.CreateObject('IntCase','Name')
Tags