Simple schedule replace on sheets

Looking for some help on schedule replacing script.
I want the logic to be like this:

  1. Look if a schedule called R1 (string input) is present on a sheet
  2. Delete schedule R1 from sheet (not delete it completely from project)
  3. Add schedule R2 (string input) (this schedule is already created)

First you have to collect all the schedules in the project.

Use Category.ByName and All Elements of Category.

Or you could start by getting all sheets…

Use the nodes mentioned.

After some bool masks I have target sheet, and both involved schedules

Now I need something to delete the -001 schedule and place down -002 one

Use this code to get the location of the original schedule view. Then delete the original schedule and use the Viewport.Create node from rhythm to add the new schedule to the sheet.

import clr
from Autodesk.DesignScript.Geometry import *

schedules = UnwrapElement(IN[0])
result = []

for schedule in schedules:
	loc = schedule.Point
OUT = result


1 Like

Hello, here is a possibility of deleting ScheduleonSheet


1 Like

The node tree is working, there is one issue with python though.

Hello, rental with nodes


1 Like

That is perfect, thank you very much!

1 Like