tried to get ChatGPT to write this code but can an error on line 24.
very new to Dynamo any help would be most appreciated.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
# Get the current document
doc = DocumentManager.Instance.CurrentDBDocument
# Start a new transaction
TransactionManager.Instance.EnsureInTransaction(doc)
# Get the current view and view template
view = doc.ActiveView
view_template = view.ViewTemplate
# Check if the view has a view template assigned
if view_template:
# Freeze the annotation categories in the view template
frozen_annotation_categories = view_template.IsolateCategories(BuiltInCategory.OST_Annotations)
else:
# Freeze the annotation categories in the view
frozen_annotation_categories = view.IsolateCategories(BuiltInCategory.OST_Annotations)
# End the transaction
TransactionManager.Instance.TransactionTaskDone()
# Return the frozen annotation categories
OUT = frozen_annotation_categories