Get/Set Location of Schedule graphics follow up

Hi @Konrad_K_Sobon, thanks a lot for sharing !!

I am trying to do almost the same show on this topic Get/set location of schedule graphics on sheet but can’t find how I can get the location of the schedules already placed in my sheet, any idea ?

This should do the trick:

# Copyright(c) 2017, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

import clr
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitNodes")
import Revit

clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *


def process_list(_func, _list):
    return map(lambda x: process_list(_func, x) if type(x) == list else _func(x), _list)


def get_location(item):
    return UnwrapElement(item).Point.ToPoint()

output = []
try:
    errorReport = None
    output = process_list(get_location, IN[0])

except:
    import traceback

    errorReport = traceback.format_exc()

# Assign your output to the OUT variable
if errorReport is None:
    OUT = output
else:
    OUT = errorReport

Please mark the answer as a solution if it answers your question.

3 Likes

It works ! Thanks @Konrad_K_Sobon