Hi All, I wish to extract door properties information of all dimensions. How do I do such in Revit Dynamo? Script attached doesn’t obtain what I wish for.
You are reading the instance parameters as you have gathered the instances (elements) rather than the types (element types). I am guessing that somewhere around index 15 there is a parameter named “Element Type” which you can use to pull the family type. This will give you access to the type value for each instance (you may want a List.GroupByKey or List.Unique here as well).
You can also try querying all the door types directly with an Element Types node followed by an All Elements Of Type node.
There may be some additional filtering (perhaps by category, parameter’s existence, or host method) required to truest get what you need in both cases.
@JacobSmall thx for that. Got what I am looking for.
How can I separate the parameters from the value?
Try this approach instead maybe…
type or instance.dyn (21.1 KB)
Or an easier method that uses custom nodes:
Well. the task is to obtain the dimension properties to create a wall opening. However, the script will have to prompt user to select which dimension to be the length and width. Hence, the workaround is below. Any idea how I can only extract the parameter name as a input?
You’ll need to use data-shapes UI’s for that. Dynamo/Dynamo Player don’t typically work with data driven dropdowns as it comes. I believe Archilab had a node that could work that way but I don’t think it comes through to dynamo player.
If you know just what the parameter names will be (ie: Width, Thickness, Height) you can work with those as a first step.
If you don’t know which parameter name you need, you can pull the name of all parameters with a Parameter.Name node.
In both cases you can use the UI++ nodes in the Data-Shapes package to produce a user interface which will allow selecting one (or multiple) parameters to work with in terms of both reporting or setting values.
In a related note, I don’t recommend the ‘Type or Instance’ node unless you have to. Behavior can be inconsistent based on how the model is set up - in some cases you might be working with both type parameters and instance parameters for a name like “width”.
I’d say if there are two parameters for an element at type/instance level with the same name, we’ve got some big fish to fry!
More of a concern with the “width” of a curtain wall door (instance based) and the “width” of a wall hosted door (type based)… that leads to the “wait which am I working with?” concern.