Hi, I got python code going to number the text automatically but it numbers empty paragraphs between notes for spacing. Does anyone got any ideas to make it skip every second paragraphs or something? Cheers.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
import System
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
dataEnteringNode = IN
textNotes = IN[0]
if not isinstance(textNotes, list):
textNotes = [textNotes]
TransactionManager.Instance.EnsureInTransaction(doc)
for textNote in textNotes:
textNote = UnwrapElement(textNote)
formatText = textNote.GetFormattedText()
textRange = formatText.AsTextRange()
listType = System.Enum.Parse(Autodesk.Revit.DB.ListType, "ArabicNumbers")
formatText.SetListType(textRange,listType)
formatText.SetListStartNumber(textRange, IN[1])
formatText.SetAllCapsStatus(True)
textNote.SetFormattedText(formatText)
TransactionManager.Instance.TransactionTaskDone()
OUT = textNotes