Move schedule graphics on sheet

I have a series of scripts that I run on sheets in our models: renumbering views, aligning views across sheets, aligning view on the sheet, etc. Most of these scripts are dependent on the titleblock origin being located at the Revit origin, which most of the time it is, however for some reason people in my office occasionally move the title block away from the origin. My guess is probably by accident. regardless of why they do it, it creates problems with all my scripts.

So what I am trying to do is add a section of script at the beginning of each of these scripts that grabs everything on that sheet, title block, view, schedules, symbols, text notes, and moves them along a vector between the titleblock origin and Revit origin. So far it works great at moving views, the titleblock, and symbols, however I cannot find a way to select the schedule graphics and text notes on the sheet and get them to move.

Does anyone have a solution for this or any ideas on how I might approach it?

Instead of moving all of the objects in a view why don’t you just calculate the difference between revit origin and sheet origin and then adjust for that in your code that aligns things.

That is the way I had originally tried to make it work, however I could not get the math to work out correctly. I could get it to work assuming that the the moved elements had not crossed the x or y axis. When it moves across an axis I need to go from adding the margin of the title block to subtracting the margin, which I can’t figure out how to do. I’m sure there is some easy python to do this but my scripting abilities are nonexistent.

Hey did you ever figure this out? From taking a quick look at the api, the schedules don’t seem to have the setBoxCenter function that viewports do. This best way I could see doing it is getting the master schedule ID from the schedule, deleting it, and creating a new version of that schedule where you want, though I haven’t had a chance to test it.

I have not figured this out yet, been really buys building new computers for the office. Thanks for the ideas, I will give this a try and let you know how it works. Probably won’t happen for at least a few days.

Hey lads,

Late to the party but if you or anyone reading was curious about a solution, you can move a ScheduleSheetInstance using a minimum of (4) nodes in addition to the schedules you are moving:

  1. Transaction.Start
  2. Vector (some vector you will be moving for example Vector.ByCoordinates)
  3. Element.MoveByVector
  4. Transaction.End

Hope this helps!

1 Like

Dynamonkey,

Thanks for the information, I always appreciate people that add their solutions even if it is long after the post, you never know who will find it useful in the future. Also in that vein, I solved my problem by changing from my scripts relying on the Revit origin of the sheet to referencing the origin of a nested family in the title block.

Hi, can you elaborate on this a little bit? How are the Transaction nodes to be connected to the Element.MoveByVector? Thank you in advance!

Hi Edita,

As with any transaction, there is a Start, Process, and End. You would follow accordingly, placing the Transaction.Start in the beginning which you could use to pass the element you want to move, connect the end of that node to Element.MoveByVector and connect that end to Transaction.End.

1 Like