Shadow Object ServiceΒΆ

Service for accessing shadow objects. Shadow receptor objects can be loaded and its content modified and sent back to windPRO. A small example can be found below.

import time
import os
from windproapi.utils import get_windpro_sample_path
from windproapi import WindProApi
from windproapi import nan_to_skipvalue

# Opening windPRO
_windproapi = WindProApi()
working_dir = os.path.join(get_windpro_sample_path('3.6'), 'Ebeltoft - Denmark\\3.6')
project_path = os.path.join(working_dir, 'DEMO - Ebeltoft, DK.w36p')

_windproapi.start_windpro_random_port()

# Services
project_service = _windproapi.get_service('ProjectService')
objects_service = _windproapi.get_service('ObjectsService')
obj_shadow_service = _windproapi.get_service('ObjShadowService')

# Loading project
project_service.LoadFromFile(filename=project_path)

objs = objects_service.GetObjects(apiObjType='Shadow')

# Loading are object specific data
shadow_obj = obj_shadow_service.GetShadowObject(objs[0].Handle)

# Changing height of window and height above ground
shadow_obj.Height = 2
shadow_obj.HeightAboveGround = 4.0

# Changing the direction of the window. Watch out, this is in the same coordinate system as the wind direction whereas
# it is in degree from south in windPRO
shadow_obj.AngleShadow = 210

nan_to_skipvalue(shadow_obj)
obj_shadow_service.SetShadowObject(shadow_obj)