Jump to content

maziar1432

Members
  • Posts

    2
  • Joined

  • Last visited

maziar1432's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. import sys sys.path.append(r'C:\\Program Files\\DIgSILENT\\PowerFactory 2023 SP2\\Python\\3.11') if __name__ == "__main__": import powerfactory as pf app = pf.GetApplication() if app is None: raise Exception('Getting PowerFactory application failed') # Project name and study case projName = 'Camden Substation' study_case = 'Consolidated ckts' # Activate project project = app.ActivateProject(projName) proj = app.GetActiveProject() # Get the study case folder and activate project oFolder_studycase = app.GetProjectFolder('study') oCase = oFolder_studycase.GetContents(study_case)[0] oCase.Activate() # Get the elmXNet object elmXNet = app.GetCalcRelevantObjects('External Grid.elmXNet') # Get the elmRes object p = elmXNet.GetAttribute('c:pl') This's what I'm running on PF 2023 SP2. Hope I understood your question well!
  2. I'm running initial calculation and RMS simulation in my script and want to get the active power and reactive power coming from the ElmXNet element. I have following lines in my script to retrieve the data: # Get the ElmXnet element xnet = app.GetCalcRelevantObjects('External Grid.ElmXnet') p = xnet.GetAttribute('c:pl') and I'm getting this error: AttributeError: 'DataObject' object has no attribute 'c:pl' wondering if anyone can help me with that and let me know what attribute I should call for this purpose. I've tried pl, p, c:p:bus1 as well and get the similar error. Thanks
×
×
  • Create New...