Closed blackkoffie closed 7 years ago
Yes, the underlay works different in 2017. It could now be switched off via:
element.SetUnderlayRange(ElementId(-1), ElementId(-1))
Obviously it needs to check for the version first: There is a fix in PR 227 , in case you need it before @eirannejad merges after review..
Resolved. Thanks @hdm-dt-fb for the fix and PR
Hi,
I changed the script .. But does not work, getting the error:
Can you see what goes wrong?
import clr clr.AddReference('RevitAPI') clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import TaskDialog from Autodesk.Revit.DB import Transaction from Autodesk.Revit.DB import ElementId from Autodesk.Revit.DB import BuiltInParameter, BuiltInCategory
doc = revit.ActiveUIDocument.Document uidoc = revit.ActiveUIDocument
selection = uidoc.Selection selection_ids = selection.GetElementIds()
if selection_ids.Count > 0: t = Transaction(doc, 'Batch Set Underlay to None') t.Start()
for element_id in selection_ids: element = doc.GetElement(element_id) if element.Category.Id.IntegerValue == int(BuiltInCategory.OST_Views) \ and (element.CanBePrinted): p = element.get_Parameter(BuiltInParameter.VIEW_UNDERLAY_ID) if p is not None: element.SetUnderlayRange(ElementId(-1), ElementId(-1))
t.Commit() else: TaskDialog.Show('Remove Underlay', 'Select Views to Remove Underlay')
On 09 Aug, 2017, at 03:25 PM, hdm-dt-fb notifications@github.com wrote:
yes, the underlay works different in 2017. It could now be switched off via: element.SetUnderlayRange(ElementId(-1), ElementId(-1)) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
This does not seem to be the latest version with the rvt-version check. If you update pyRevit you should have it. If that is currently not possible for you, find the current version here:
As a hint for future code snippets:
If you paste them, put them in between triple back ticks, then formatting gets not lost.
@hdm-dt-fb Apparently he's replied in email so markdown is not supported. I didn't know that. Thanks for the response btw
ouh I did not know that is possible.. yep you're welcome!
Thanks Guys, sorry for replying on the email. I'll test it soon.
@rbaggen No need for the apology man. We do reply in emails all the time. We just didn't know the formatting doesn't work from emails Thanks for reporting the issue 👍
Hi,
I work with the Revit 2017.2 (17.0.1128.0 20170419_0315(x64) 2017.2.1 ) Is there a way you can fix this for me?