I want to change the URL parameter value to nothing for all families but I can’t seem to get it right when collecting all families. The script works when conecting one family (Specifik familj) to the “Byter parameterns värde”-group. any suggestions? Im working in revit 2018.
It’s because URL is TYPE parameter, not family one, you should do something like this:
Thank you, that’s one step further of what i want to do. But i want dynamo to change the URL for all families without me having to pick each categorie and run the script. So I guess that some sorting needs to be done to be able to solve the problem?
Well, I’m not sure how to achieve this in dynamo but this code will do the thing:
public static void SetAllTypesURLValue(string url)
Document document = RevitServices.Persistence.DocumentManager.Instance.CurrentDBDocument;
var symbolCollector = new FilteredElementCollector(document)
using (Transaction transaction = new Transaction(document, "SetURL"))
foreach (FamilySymbol fs in symbolCollector)
If you are interested in developing in Revit API i recommend this to begin with, or you can re write it in Python.
You would have to check to see if each instance has the URL parameter first. If it does, use the instance. If it doesn’t, get the type instead. Then you can set the value for each instance or type at the same time.
You have also to check if its not read only.
Thank you, I’m a rookie when it comes to coding so I don’t really know where to apply this code
Send me your email in private message, I will send you compiled file, just import it like any other package.
Here’s a dumb way to do it…
Very slow. But you can get a list of what has a URL field and what doesn’t with the null output.
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager
# Import RevitAPI
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
# Import ToDSType(bool) extension method
from Revit.Elements import *
allTypes = FilteredElementCollector(doc).WhereElementIsElementType().ToElements()
OUT = allTypes