- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Cree un una tabla de planificacion,pero no me sale con el orden que quiero.
Aqui esta mis codigo.
I created a planning table, but it did not come out in the order I want.
Here is my code.
// built in parameters / fields to add in schedule
private static BuiltInParameter[] BiParams = new BuiltInParameter[]
{ BuiltInParameter.RBS_SECTION,
BuiltInParameter.RBS_PIPE_FIXTURE_UNITS_PARAM,
BuiltInParameter.RBS_PIPE_DIAMETER_PARAM,
BuiltInParameter.CURVE_ELEM_LENGTH,
BuiltInParameter.RBS_PIPE_PRESSUREDROP_PARAM
};
...
try
{
using (Transaction tx = new Transaction(doc, "Creating Schedule"))
{
tx.Start();
//Create an empty view schedule of pipe category.
ElementId pipeCategoryId = new ElementId(BuiltInCategory.OST_PipeCurves);
ViewSchedule pipeSchedule = ViewSchedule.CreateSchedule(doc, pipeCategoryId, ElementId.InvalidElementId);
pipeSchedule.Name = "Calculos Hidraulicos";
//Iterate all the schedulable field gotten from the walls view schedule.
foreach (SchedulableField schedulableField in pipeSchedule.Definition.GetSchedulableFields())
{
// check field if in params
if (CheckField(schedulableField))
{
ScheduleField field = pipeSchedule.Definition.AddField(schedulableField);
field.HorizontalAlignment = ScheduleHorizontalAlignment.Center;
}
}
doc.Regenerate();
// close transaction
tx.Commit();
// set active view
uidoc.ActiveView = pipeSchedule;
}
// Assuming that everything went right return Result.Succeeded
return Result.Succeeded;
}
public bool CheckField(SchedulableField vs)
{
foreach (BuiltInParameter bip in BiParams)
{
if (new ElementId(bip) == vs.ParameterId)
return true;
}
return false;
}
Aqui esta la imagen(resultado)
Here is the image (result)
Este es el oredn que qusiera obtener:
This is the order I would like to get:
{ BuiltInParameter.RBS_SECTION,
BuiltInParameter.RBS_PIPE_FIXTURE_UNITS_PARAM,
BuiltInParameter.RBS_PIPE_DIAMETER_PARAM,
BuiltInParameter.CURVE_ELEM_LENGTH,
BuiltInParameter.RBS_PIPE_PRESSUREDROP_PARAM
};
Solved! Go to Solution.