The title says it all.
I use Clockwork’s Element.CopyByVector all the time for large amounts of Revit elements and I want to copy the tags along with the element.
It’s easier said than done. One idea is to get a list of all my tags in the entire model, and try to filter them out based on the elements that I’ve selected. I’ll post more info and files as I get further or find more road blocks.
Any help whatsoever is absolutely appreciated.
One method to grab the elements that are tagged via the tag is to use Tag.TaggedElement.
I’m aware of Tag.TaggedElement. Basically I I want to do the opposite of this function.
One thought would be to get all the tags in the project and get all the elements tagged via Tag.Tagged Element. Then filter those elements through my selected elements. This seems extremely inefficient though.
If only a Element.ElementTag existed hah…
This thread might assist in writing a python script to obtain the element of an inputted tag.
You can build your own with dictionaries.
Note: this is in 1.3.x, for 2.0.x dictionaries changed a bit.
Here is an example for getting the door tags related to a door:
The graph image:
And the graph itself:
getDoorTagsFromDoor.dyn (9.4 KB)
This is awesome. I’ve never used dictionaries, its kinda what I was thinking about doing but way better. In fact it could improve a ton of my programs! I’m still using 1.3.2 so this should work fine.
Maybe I’ll collect all the categories of the elements I’ve selected and create a dictionary of tags from them. Then pull the tags out with my element list.
Thanks for the help and introducing me to dictionaries!
Glad to help out! when I was introduced to dictionaries it was life changing.
Soo the dictionary worked but I’m still not able to copy the tags. It must be because the tags need an actual view to be placed on considering they are an annotation…
This was kind of short sighted of me not to think of that. Maybe I can use the “Element.CopyFromViewToView” node from the Rhythm package somehow.
I got this far… I may try to duplicate the tags into an actual view and move them based on my distance vector.
Duplicate Elements and Tags.dyn (31.7 KB)
I’m still not at the point where I can duplicate an element and its tag together, which was the objective of this original post.
I’m starting to play with creating a new tag from the original tag but associated with the duplicated elements on my selected view. Then move it with the same vector I used to place duplicate the element. I’m actually starting to crash my video card as well every few times I run it (probably due to the dictionary lookup. It’s an AMD ATI FirePro V4800 (FireGL V) which I’ve suspected I need to upgrade for a while now.
I’ll update if I make any meaningful progress.
Feel free to comment or ask anything if you’re interested in solving this
Turn off the geometry preview for tags.
Right Click>Disable Preview. In Revit 1.3.x, tags “preview” their text and it causes all sorts of madness for graphics. Or just turn off geometry preview in Dynamo all together for now.
I would think Revit 2018 would suffice.
Ask and you shall receive.
CopyElementsAndTags.rvt (904 KB)
Duplicate Elements and Tags.dyn (32.5 KB)
I’m using the junction boxes as location markers to get my vector for duplication.
Edit: Revit 2018, Dynamo 1.3.2
I updated the Dynamo file
Finally got it. I was getting a ton of errors with the duplication node. It kept expecting a document when I was feeding it it views for some reason.
I think the method changes depending on what type of transform you feed it…
I used this method RevitAPIdocs
Here it is. The script duplicates elements and their tags without actually selecting the tags. The tags also hosts itself to the new duplicated elements. The nodes in red are things the user will need to fill out.
Duplicate Elements and Tags.dyn (30.4 KB)
Please, first I appreciate your effort because that script is very nice, and I have question about two nodes, what should choose
For these two nodes, you need to click on an element in Revit after clicking select. This will get the location of the elements and create a vector between the origin and destination elements you selected (You can only pick one for each). When the program runs, the elements you are copying will get copied to a new location based on where they are located plus the vector we created.