i can't drop a rfa files after i canceled in Revit site component

i can't drop a rfa files after i canceled in Revit site component

nmega560
Community Visitor Community Visitor
194 Views
1 Reply
Message 1 of 2

i can't drop a rfa files after i canceled in Revit site component

nmega560
Community Visitor
Community Visitor

I am creating a Revit plugin and i used WPF for dock able panels. In my local computer i have some plants (*.rfa files). In my project i am dragging and dropping the rfa file from WPF to Revit Site component. First time its working fine. but after i drag and dropped and canceled it. After that i tired again the same file I can drag, but while dropping its disappeared. If i create new project or open project. its working normally. Problem is within the project.

 My drag method :

private void grdPlants_MouseLeave(object sender, MouseEventArgs e)
{
try
{
if (!AppData.IsLoggedIn)
{
AppData.HidePanelEvent.Raise();
return;
}

draggedPlant = (PlantsWithTagName)grdPlants.SelectedItem;

if (clickCount == 1 && draggedPlant != null)
{
string path = GetRFAFilePath(draggedPlant.id);
AppData.SelectedPlantId = draggedPlant.id;
if (!string.IsNullOrEmpty(path))
{
FileInfo fileInfo = new FileInfo(path);

if (fileInfo.Exists)
{
DataObject myDataObject = new DataObject();
StringCollection coll = new StringCollection
{
fileInfo.FullName
};
myDataObject.SetFileDropList(coll);

if (doc != null)
{
DragDrop.DoDragDrop(grdPlants, myDataObject, DragDropEffects.Copy);
}
ClearErrors();
}
else
{
ShowError(PlanterPlugin.Properties.Resources.PLANT_NOT_LINKED, false, true);
}
}
else
{
openWindows["plant_details"].Activate();
}
clickCount = 0;
}
}
catch (Exception ex)
{
Logger.Write(ex);
}
}

0 Likes
195 Views
1 Reply
Reply (1)
Message 2 of 2

TripleM-Dev.net
Advisor
Advisor

Hi,

 

That's standard behaviour of Revit.

If the family already exists in the project and is determined by Revit the dropped family is not changed from the already loaded one the 'placement' action doesn't activate.

 

Try it by dragging the family manually into the project, the second time there won't be a placement action.

If you change the already loaded family, you will get the overwrite dialog. If the family is overwritten in the project the placement action would take place again.

 

- Michel

0 Likes