Springs.Collector.ElementSketch for linked elements

Hello. I am trying to make a script that takes the sketch lines of floors for use in something else. I have been using springs nodes’ Collector.ElementSketch in Dynamo 1.3.2 and it has worked for all floors within the host file of Revit but when I try to use linked floors, it returns a null.

I am pretty new to Dynamo but I am assuming it is because since the element is a linked element, it doesn’t store the sketch lines used to make it/cannot access it? I am using Revit 2017 with Dynamo 1.3.2 and all of the most recent versions of the packages.

Is there a way to make linked elements work with this node?

Alternatively, I was thinking of duplicating the floors into the host files temporarily to be used in the script but have been having a hard time figuring out how.

I don’t believe that there is a way to make that node work with a linked file. The reason is that in the API there is no way to easily map the sketch elements to the element they belong to. The way that this is accomplished (per the Revit API master himself http://thebuildingcoder.typepad.com/blog/2010/11/access-to-sketch-and-sketch-plane.html) in this node is to create a sub-transaction that deletes each floor/roof and then rollback (undo) that deletion. The act of deleting something returns the ids of every deleted element - which is then stored and then the list of sketch elements is then searched for those ids to then return to the user the sketch element curves.

Because you cannot delete elements in a linked file, this node cannot work on a linked file. This is an area that the API could definitely be improved.

3 Likes

Start an idea station page for it or find a link to one so we can all upvote it. :slight_smile:

Unfortunately, @Ben_Osborne nailed it - you need to have write access to the model to be able to extract that kind of information. In some cases there’s a numerical relationship between the id of the floor element and its sketch and we can skip the deletion operation, but it’s never guaranteed.

1 Like

You could get the geometry still, explode to faces, filter out faces which don’t have a +Z component on their normal (meaning they are the bottom or side of the floor), and then get the curves which make up that face for use in Dynamo.

Won’t be able to edit the floor itself but youcould do other things.

1 Like

something like:

  • use TAB select in Revit
  • copy / paste in the same place
  • edit boundary
  • select boundary
  • copy to clipboard
  • use undo several times
  • paste the line
  • extract the lines
  • get the points
  • delete the line?

But how to do this in Dynamo?

I used your idea
Copy to the current model, do the thing, and delete in the final

And ??
Did it work??
That was a very intricate workaround.
I wonder if i could use use a Journal file to do the same?
@jacob.small
@Andreas_Dieckmann
If it can it would open up a new way to do bulk edits.

Yes, it worked!

I don’t know about the Journal File

@kennyb6

1 Like

Responding as Jacob.Small is another user.

Journal Automation does work, and is what “Dynamo Automation” is built around - GitHub - andydandy74/DynamoAutomation: Batch-processing of Revit models using the Dynamo visual programming environment

1 Like