I want to change user selected pipe 's offset (-50mm) by using Revit 2014 API. I write a loop as blow.
foreach (var element in sel.Elements)
{
if (element is Pipe)
{
var s = element as Pipe;
var lCurve = s.Location as LocationCurve;
lCurve.Move(new XYZ(0, 0, -50 / 304.8));
}
}
But when the code Run. The Real offset was -600mm.I debug the code and found when a pipe's offset changed,other pipes who connect to
this pipe were also changed.Because User selected 12 pipes .So the offset were 12*-50=-600;
Please give me some suggest to do this .
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Beckhans,
I would suggest trying to use the ElementTransformUtils.MoveElements method and passing in all of the selected element ids in one single call instead of looping over them one by one.
I hope this helps.
Cheers,
Jeremy