hdse
-
Posts
3 -
Joined
-
Last visited
Posts posted by hdse
-
-
Thank you very much, it helped a lot.
However, I don't know why the following is not working.
I want to create a Wind Farm and add wind turbine locations from a .txt fileturbinespath="C:\Users\hdse\Desktop\d300D900\test.txt"
Set Project = ReportingAssistant.SelectedHierarchyMember
' Insert a Wind Farm
Set Member = Project.Insertions.New.ByClassID(ehmcTurbineSiteGroup).Execute
Set WindFarm = ReportingAssistant.TypeCaster.CastMemberToWindFarm(Member)
' Insert the Turbine Sites
Set Member = WindFarm.AsIHierarchyMember.Insertions.FromFile.ByClassID(ehmcTurbineSite).Execute(turbinespath, Nothing)
Set TurbineSites = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(Member)
The Wind Farm is created but the importing of the site locations is not working.
The error is:Script control reported the error:
Object required: 'ByClassID(...)'
I also tried to insert a generator in the wind farm like this:generatorpath="C:\ProgramData\WAsP\WAsP11\Wind turbine generators\Vestas V112-3.0 MW"
' Insert a Wind Farm
Set Member = Project.Insertions.New.ByClassID(ehmcTurbineSiteGroup).Execute
Set WindFarm = ReportingAssistant.TypeCaster.CastMemberToWindFarm(Member)
' Insert a generator
Set Member = WindFarm.AsIhierarchyMember.Insertions.FromFile.ByClassID(ehmcWindTurbineGenerator).Execute(generatorpath, Nothing)
Set Generator = ReportingAssistant.TypeCaster.CastMemberToWindTurbineGenerator(Member)
and it says:Script control reported the error:
could not insert a Wind turbine generator to the hierarchy
Thank you for your help ! -
Hello,
I am writing a script in order to automatize the manipulation of the workspace. In this context I want, to start with, to import a vector map and an observed wind climate.
My code is the following:mappath="C:\Users\hdse\Documents\sea.map"
owcpath="C:\Users\hdse\Documents\Portugal.owc"
Set Project = ReportingAssistant.SelectedHierarchyMember
Set Cluster = Project.Insertions.New.ByClassID(ehmcTurbineSiteGroup).Execute
Set hmOwc = Project.Insertions.FromFile.ByClassID(ehmcObservedWindClimate).Execute(owcpath, Nothing)
Set MapSea = Project.Insertions.FromFile.ByClassID(ehmcVectorMap).Execute(mappath,Nothing)
The turbine site group is created successfully, but I have this error:Script control reported the error:
Object required: 'Project.Insertions.FromFile.ByClassID(...)'
The last execution line attempt was for an unknown line number.
Script: 'essai1', version: 11.01.0001
The problem is coming from the file insertion, but I could`nt find the mistake.
I hope you will be able to help me
Thank you !
Inserting from a file
in Scripting and automation
Posted
I publish my code for importing turbines locations from a file, if it can be useful to someone.