Copy elements and associated tags

clockwork
dynamo

#1

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.


#2

One method to grab the elements that are tagged via the tag is to use Tag.TaggedElement.


#3

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…


#4

This thread might assist in writing a python script to obtain the element of an inputted tag.
http://dynamobim.org/forums/topic/get-tag-host-element/


#5

You can build your own with dictionaries. :slight_smile:
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)


#6

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!


#7

Glad to help out! :slightly_smiling_face: when I was introduced to dictionaries it was life changing.


#8

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)


#9

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 :grin:


#10

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.


#11
  • What kind of elements?
  • Copy in same view?
  • Copy how? (same place, other level, etc)
  • Can you make a small sample file? It makes it difficult for people to really know what to suggest without some context. :slight_smile:

#12
  • for now just Light Fixtures, Electrical Fixtures, Electrical Equipment. i would assume the program could be used for most types of system elements.

  • Copy the tags into a different view

  • I copy the elements with Clockwork’s Element.CopyByVector. So really any direction. I have this part down… its getting the tags to come along with the element that is a challenge for me.

  • Ya you’re right its kinda of confusing without a sample. Any preferred version of Revit?


#13

I would think Revit 2018 would suffice. :slight_smile:


#14

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