Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Openstudio complains about argument to Workspace.addObjects() but all objects are successfully added

I have a measure that injects all the objects in an IDF file into the main idf file. It has been working on every file except one, the 5ZoneFanCoilDOAS_ERVOnAirLoopMainBranch.idf example file. Here are all the files.

#load the idf file
source_idf = OpenStudio::IdfFile::load(OpenStudio::Path.new(source_idf_path)).get
#add everything from the file
workspace.addObjects(source_idf.objects)

image description

As far as I can tell, all the objects are successfully added, but Openstudio complains about Workspace.addObjects() being given an incompatible argument.

[15:31:30.476167 ERROR] Found error in state 'preprocess' with message ["Wrong arguments for overloaded method 'Workspace.addObjects'.
Possible C/C++ prototypes are:
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::IdfObject,std::allocator< openstudio::IdfObject > > const &idfObjects, bool checkNames)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::IdfObject,std::allocator< openstudio::IdfObject > > const &idfObjects)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > const &objects, bool checkNames)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > const &objects)
::/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/energyplus.rb:194:in `addObjects'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/energyplus.rb:194:in `energyplus_preprocess'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/jobs/run_preprocess.rb:58:in `perform'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/run.rb:269:in `step'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/run.rb:216:in `run'
:/openstudio_cli.rb:848:in `execute'
:/openstudio_cli.rb:639:in `execute'
:/openstudio_cli.rb:1614:in `<main>'
eval:107:in `eval'
eval:107:in `require_embedded_absolute'
eval:92:in `block in require'
eval:86:in `each'
eval:86:in `require'
eval:2:in `<main>'"]}

Openstudio complains about argument to Workspace.addObjects() but all objects are successfully added

I have a measure that injects all the objects in an IDF file into the main idf file. It has been working on every file except one, the 5ZoneFanCoilDOAS_ERVOnAirLoopMainBranch.idf example file. Here are all the files.

#load the idf file
source_idf = OpenStudio::IdfFile::load(OpenStudio::Path.new(source_idf_path)).get
#add everything from the file
workspace.addObjects(source_idf.objects)

image description

As far as I can tell, all the objects are successfully added, but Openstudio complains about Workspace.addObjects() being given an incompatible argument.

[15:31:30.476167 ERROR] Found error in state 'preprocess' with message ["Wrong arguments for overloaded method 'Workspace.addObjects'.
Possible C/C++ prototypes are:
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::IdfObject,std::allocator< openstudio::IdfObject > > const &idfObjects, bool checkNames)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::IdfObject,std::allocator< openstudio::IdfObject > > const &idfObjects)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > const &objects, bool checkNames)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > const &objects)
::/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/energyplus.rb:194:in `addObjects'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/energyplus.rb:194:in `energyplus_preprocess'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/jobs/run_preprocess.rb:58:in `perform'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/run.rb:269:in `step'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/run.rb:216:in `run'
:/openstudio_cli.rb:848:in `execute'
:/openstudio_cli.rb:639:in `execute'
:/openstudio_cli.rb:1614:in `<main>'
eval:107:in `eval'
eval:107:in `require_embedded_absolute'
eval:92:in `block in require'
eval:86:in `each'
eval:86:in `require'
eval:2:in `<main>'"]}

Openstudio complains about argument to Workspace.addObjects() but all objects are successfully added

I have a measure that injects all the objects in an IDF file into the main idf file. It has been working on every file except one, the 5ZoneFanCoilDOAS_ERVOnAirLoopMainBranch.idf example file. Here are all the files.

#load the idf file
source_idf = OpenStudio::IdfFile::load(OpenStudio::Path.new(source_idf_path)).get
#add everything from the file
workspace.addObjects(source_idf.objects)

image description

As far as I can tell, all the objects are successfully added, but Openstudio complains about Workspace.addObjects() being given an incompatible argument.

[15:31:30.476167 ERROR] Found error in state 'preprocess' with message ["Wrong arguments for overloaded method 'Workspace.addObjects'.
Possible C/C++ prototypes are:
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::IdfObject,std::allocator< openstudio::IdfObject > > const &idfObjects, bool checkNames)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::IdfObject,std::allocator< openstudio::IdfObject > > const &idfObjects)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > const &objects, bool checkNames)
    std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > Workspace.addObjects(std::vector< openstudio::WorkspaceObject,std::allocator< openstudio::WorkspaceObject > > const &objects)
::/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/energyplus.rb:194:in `addObjects'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/energyplus.rb:194:in `energyplus_preprocess'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/jobs/run_preprocess.rb:58:in `perform'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/run.rb:269:in `step'
:/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/run.rb:216:in `run'
:/openstudio_cli.rb:848:in `execute'
:/openstudio_cli.rb:639:in `execute'
:/openstudio_cli.rb:1614:in `<main>'
eval:107:in `eval'
eval:107:in `require_embedded_absolute'
eval:92:in `block in require'
eval:86:in `each'
eval:86:in `require'
eval:2:in `<main>'"]}

Post Script in response to @mdahlhausen's comment.

image description

However, the in.idf was never generated and there is a new "run" error file referencing 'Workspace.addObjects' which doesn't exist in my measure any more since I replaced it with @mdahlhausen's code, not even as a comment.

image description image description