Replacing a family by set rotation not working

Hello I am having trouble replacing a family with a script the was working fine before. It appears that now, the new families are getting placed at different orientations where they were always aligned to their origin before. Now they seem random, however they are not behaving like the angles are correct because the way I have this set up, it shouldnt matter the new families orientation should be set to the original family’s (family to be replaced) anyways, however, it is rotating one of them. Not sure if this helps or not but it appears to only be rotating the first one, and also we just upgraded to Revit 2018, does anybody know whats going wrong? Thanks!

My guess would be the current selection node isn’t working properly. I would try disconnecting one of the first nodes of the graph and running it. This will reset everything. Then reattach it and try your selection again. Make sure that selection node gets whatever you are selecting and see if it work properly for the rest of the graph. i.e. fix the beginning and the rest should fix itself.

@nathaniel.g.macdonal
Thanks for you help but after I tried that, it still doesnt work. I think the problem is some how related the fact that it is coming up empty, but still has its element ID. Any Idea how to fix this? Thanks!

Could you send the model file and script so I can test it?

Fix Selected Starline Busway-250A family Orientation.dyn (66.5 KB)
Starline Busway-250A.rfa (420 KB)
Sure, here you go thanks!

It is definiately a problem with dynamo not refreshing the input when I toggle the refresh button. I am having the same issue in another script. Is this a bug in this version of dynamo? I tried it with the pick elements node, but got the same exact problem:

Actually now I believe it may be a problem with the new family it is placing. for some reason, everytime I press run, it wants to use the same element ID on the new element it is placing as it did the previous time. Since it is doing that, it is thereby deleting any families actually created in the previous run. and appears to be using their data of orientation to place the new families. Both of which are wrong. Is there a way to fix this?

Alright, this is mushrooming into a large problem for me. Many of my users are reporting issues with dynamo not refreshing in between uses. and all those scripts were working fine before. @Nick_Boyts Do you happen to have any idea what is going on? Thanks in advance!

Have you tried closing Dynamo between runs?

I actually encountered the same “empty” w/ Element ID last night when I was looking at your graph from your other post but I hadn’t made mention of it because I wanted to be certain it was of the same cause as what you are seeing here. It did occur after rerunning the graph multiple times but it is preventable by “undoing” the previous run in Revit and refreshing the graph

When this problem first presented itself I did. But I havent sense the changes I made. at that time it didnt help.

If I undo every run, I wont make any progress, so I am not following you here.

Ah I was assuming that as you re-run you are overriding the previous runs which is essentially undoing and redoing. I think refreshing the graph would still solve the issue

I just had a minute to look at your graph and now I understand how you are using it now and why undo doesn’t make sense. The culprit seems to lie in the deletion of the elements. They need to be deleted after you have gotten their locations, vectors, parameter values, etc. otherwise the current selection collector returns “empty” elements and the next run of the graph doesn’t update so it show you the last run’s values. A Passthrough node before the Springs.Doc.DeleteElements might do it.

What is a passthrough node?

Passthrough is in the Clockwork package, but it can be written in a code block like so:

Essentially you need to force the order of operations of your graph so that the elements are not deleted at the same time you are trying to get data from them

No that doesnt seem to work as far as I can tell:

Did you reset before running your graph with the Passthrough node? Your input shows the empty element so even when it does work it’s going to pass through the empty element.

1 Like

Yes, i did reset it. I reset it before every run. there is seemingly no response to the toggle switch.

I meant close Dynamo and reopen.