Hi, @naveen.kumar.t
Thanks for note about transaction management. It makes my code work, but it's simplidied sample. Before it I use to work with wraper method includes transaction:
public static void CreateTransaction(Document document, string transactionName, Action action)
{
lock (SingleLocker)
{
using (var transaction = new Transaction(document))
{
transaction.Start(transactionName);
try
{
action?.Invoke();
transaction.Commit();
}
catch (Exception)
{
transaction.RollBack();
}
}
... and on this case execusion looks like this:
public static void PlaceFs(Document doc, List<ComponentInfo> combs, XYZ pt)
{
TransactionManager.CreateTransaction(doc, "Размещение вертикальных элементов", () =>
{
{
try
{
foreach (var item in combs)
{
pt = new XYZ(pt.X, pt.Y, (double)item.Z);
RevitFunctions.CreateNewInstance(doc, item, pt);
}
}
catch { }
}
}
);
}
Let me ask in another way -- what is the best practice to place multiple family symbols (in my case its mechanical elements) collected from FilterElementCollector?