The concept works quite well. But, my property DA (see previous post) have a problem which I don’t really understand.
Although I’m storing the retrieved IGH_DataAccess iterator in the property field m_DA (and DA works fine after that in that very Solution) it is however no longer valid in the next solution.
< scratching head >
The only way I could get it to work was to set
m_DA to null and then retreive the iterator again in the next round, like so:
protected override void BeforeSolveInstance()
// Spookish this, but I must set m_DA to null and then refresh the iterator via
// Reflection (the DA property far below which calls `GetDataAccess()` )
m_DA = null;
// Data Access (property DA) is now made available for property getters, etc.
m_DA = DA;
// Now there's a "DA" which works in the rest of the class and not only in
// the `SolveInstance` method.
private IGH_DataAccess m_DA;
private IGH_DataAccess DA
if (m_DA == null)
m_DA = GetDataAccess();
Q: Why do I have to re-retreive and re-assign “
m_DA” again every new Solution? Any idea?