I am new to utilizing Dynamo, so there may be some dumb questions here, or this may just not be possible in general, but I figured this would be the best place to figure out if this goal is a pipe dream.
I am trying to devise a way to have our card reader family read/import the door tag from the linked architectural model so that I can generate our security schedule without manually entering what door each card reader is tied to. I know there are methods to copy instance parameters from one family to another, but I didn’t know if there is a functionality to make the script recognize which specific instance needs to be compared. For example, in my ideal world,d I would be able to put together a script that would know each of these 5 specific card readers need to have their instance parameter replaced by the door they are adjacent to. It feels like this is too far-fetched to be possible since I do not know of a way to associate the card reader with the door, but I didn’t know if there was some dynamo magic out there that I haven’t stumbled upon yet.
Is there a geometric relationship between the reader and the door? Such as ‘will always be N units away from the strike side?
There isn’t a set distance that they will always be at, but a majority of the time the door closest to them is the one they will be assigned to. If there is a way to align them based on distance from one to the next, I think that would get me close enough, and I can always do a passover through the model to make sure they didn’t accidentally tag with the wrong door.
Geometry.DistanceTo would work then. I recommend starting with one view for now, and expand to full models. Some outline steps with nodes noted:
- If you have your door or hardware types set up right you can quickly filter down which doors you’re comparing from all doors visible in view. This is done by Element.GetParameterValueByName, comparison nodes like == or <= or similar, and a List.FilterByBoolMask
- From the list of doors, extract the location point.
- Next get all the card readers visible in the view.
- From the card readers extract the location point.
- Now get the distance from each selected reader point to each door. I recommend using list level of L1 for the door.
- Sort the list of readers by those distances with a List.SortByKey where the the key input is set to L2 and lacing is set to longest.
- Finally read the parameter value of each reader and write it to the associated door.
Some bonus ideas while we are here.
- Consider drawing a line from each door to the associated reader. This will make validation checks easy.
- Consider a List.UniqueItems to confirm no reader is used twice
- Consider revising your workflow if this is a common task as it is 100% automata or from a documentation standpoint. Use Dynamo to place a reader on the ‘lock’ side of each room based on your secure travel paths. Don’t host it to the wall or even consider location. Set the parameter values for document version, door mark, door GUID, and door ID on each reader, and then document version, reader mark, reader GUID, and reader ID on each door. In a separate graph use Dynamo to trace the room boundaries for a selected reader from the door strike to the nearest available mounting point. Adjust your reader type accordingly at this point. Eventually when you are happy with this logic scale the graph to all readers in a view and then in a model. Then when you are happy with all readers merge that into the graph for placing the readers and setting the association parameters. Finally (and this is VERY advanced), build a 3rd graph that leverages document versions to quickly identify and update any reader when a associated door changes, placing a revision tag around each automatically.
thank you for the advice! going to try to get around to implementing this when work slows down and will follow up if I am hitting any walls in the programming.
1 Like