F
fleuz
Someone knows why writing timephased data through code has such a bad
performance?
I've have develop a procedure to import the assignment timephased data
from a excel file into project.
This procedure is a Project add-in written in c#.
Here's a sample of the code that runs for each assignment:
Code:
--------------------
oRCProject.Application.OptionsCalculation(false, false, false, false, false, Missing.Value, false, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
for (int iQuarter = 0; iQuarter < aQuarters.Count; iQuarter++)
{
MSProject.TimeScaleValues oNewAssTSV = oNewAss.TimeScaleData(dtQuarterStart, dtQuarterFinish, MSProject.PjAssignmentTimescaledData.pjAssignmentTimescaledWork, MSProject.PjTimescaleUnit.pjTimescaleQuarters, 1);
double dQuarterValue = Convert.ToDouble(aQuarters[iQuarter]);
oNewAssTSV[1].Value = dQuarterValue;
}
--------------------
The last line of code has a very long execution time, 90% of the
elaboration time has been occupied by these code.
Furthermore the execution time grows at each call, passing from a 10ms
to 300ms after 3000 hits.
Obviously it's not only a write of a value, there're other operations
performed.
Someone know what kinds of operations are performed by this call?
There's a way to disable these operations and postpone them after the
finish of the procedure?
Thanks
performance?
I've have develop a procedure to import the assignment timephased data
from a excel file into project.
This procedure is a Project add-in written in c#.
Here's a sample of the code that runs for each assignment:
Code:
--------------------
oRCProject.Application.OptionsCalculation(false, false, false, false, false, Missing.Value, false, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
for (int iQuarter = 0; iQuarter < aQuarters.Count; iQuarter++)
{
MSProject.TimeScaleValues oNewAssTSV = oNewAss.TimeScaleData(dtQuarterStart, dtQuarterFinish, MSProject.PjAssignmentTimescaledData.pjAssignmentTimescaledWork, MSProject.PjTimescaleUnit.pjTimescaleQuarters, 1);
double dQuarterValue = Convert.ToDouble(aQuarters[iQuarter]);
oNewAssTSV[1].Value = dQuarterValue;
}
--------------------
The last line of code has a very long execution time, 90% of the
elaboration time has been occupied by these code.
Furthermore the execution time grows at each call, passing from a 10ms
to 300ms after 3000 hits.
Obviously it's not only a write of a value, there're other operations
performed.
Someone know what kinds of operations are performed by this call?
There's a way to disable these operations and postpone them after the
finish of the procedure?
Thanks