Hi my friends,
I am planing to use bottom to select familyinstance (column ) then draw floor according to its position. so i used modeless form.but the problem as i understand the Revit API consider modeless form as external application runing outside API context (I can't understand why) so i can't make transaction.Anyone can help me ???!
this message appeared
public bool CreatedropPannel(CurveArray profile, FloorType floorType,Level level)
{
Floor dropPannel;
try
{
if (profile !=null && floorType != null && level != null)
{
// normal vector
XYZ normal = XYZ.BasisZ;
// create floor
Transaction t = new Transaction(m_revit.ActiveUIDocument.Document);
t.Start("create drop panel");
//dropPannel = doc.Create.NewFloor(profile, floorType, level, true, normal);
dropPannel = m_revit.ActiveUIDocument.Document.Create.NewFloor(profile, floorType, level, true, normal);
t.Commit();
if (dropPannel == null) { return false; }
}
}
catch (Exception ex)
{
TaskDialog.Show("Revit", ex.ToString());
return false;
}
return true;
}
Thank you and best regards,
Salem