DynamoDS / DynamoRevit

Dynamo Libraries for Revit
https://dynamobim.org
336 stars 187 forks source link

Family.ByName Deletes Loaded Families #1832

Closed winterweken closed 6 years ago

winterweken commented 6 years ago

Dynamo version

1.3.2.2480

Revit version

2017

Operating system

win 10

What did you do?

Using Family.ByName to compare an external list with loaded families. Once node is removed from graph, it also removes the families it 'touched'

What did you expect to see?

For it to leave the Families in my project as they were.

What did you see instead?

All 'touched' families removed from my project.

More info here.

mjkkirschner commented 6 years ago

@kronz related to the bug @mrahmaniasl saw?

mjkkirschner commented 6 years ago

I believe this is an easy fix in the constructor for the ByName method. My guess would be to change this line: https://github.com/DynamoDS/DynamoRevit/blame/Revit2018/src/Libraries/RevitNodes/Elements/Family.cs#L128

to use Family.FromExisting instead of creating a wrapper with the internal constructor.

kronz commented 6 years ago

@mjkkirschner sounds related to what we saw, athought I was not able to delete Families with only Family.ByName (needed to also use the Family.Types AND it needed to be in a custom node).

DanBoghean commented 6 years ago

I'm having the same issue when I use the Element.SetParameterByName node.

I am currently trying to use dynamo to set a Family Type parameter to switch out door panels in a door.

Let’s say I have 3 doors all set to Door Panel “2P-G”. If I change all three doors to a new panel type “F” so that no doors use Door Panel “2P-G” any more using the dynamo script, Door Panel 2P-G gets deleted.

Problem does not occur if I run the script through Dynamo Player

I forgot to add... I am also using a Family.ByName node in the workflow and that's what seems to be causing it.

mjkkirschner commented 6 years ago

@mrahmaniasl can you share your workaround here?

QilongTang commented 6 years ago

https://github.com/DynamoDS/DynamoRevit/pull/1848 should have fixed this issue in the coming release RC1.3.3 and RC2.0,0. Closing

WspDev commented 6 years ago

@QilongTang Just wanted to report that this bug also happens when this node is frozen then unfrozen.