// Set constraint Must Start On for task with Id 5 System::SharedPtr roof = project1->get_RootTask()->get_Children()->GetById(5); roof->Set(Tsk::ConstraintType(), Aspose::Tasks::ConstraintType::MustStartOn); roof->Set(Tsk::ConstraintDate(), System::DateTime(2017, 1, 1, 9, 0, 0)); // Save project as pdf System::SharedPtr options = System::MakeObject(); options->set_StartDate(project1->Get(Prj::StartDate())); options->set_Timescale(Aspose::Tasks::Visualization::Timescale::ThirdsOfMonths); project1->Save(dataDir + u"project_MustStartOn_out.pdf", options);