Revit Drag and Drop in 2018 & 2019

Revit Drag and Drop in 2018 & 2019

IconSystem
Enthusiast Enthusiast
1,714 Views
3 Replies
Message 1 of 4

Revit Drag and Drop in 2018 & 2019

IconSystem
Enthusiast
Enthusiast

Hi,

 

I'm currently experiencing an issue in Revit(2018, same behaviour in 2018.1 & 2018.3) with drag and drop.

 

API Function that i'm using for the drag and drop:

Autodesk.Revit.UI.UIApplication.DoDragDrop(Object, IDropHandler)

 

Problem:I have created a custom Add-in which works well in Revit version 2014-2017 but in Revit 2018 and 2019 this doesn't seem to work.  I've attached a screenshot which how far i can get but the refit family is never actually dropped into Revit.

 

Any thoughts on what could cause this?

 

Regards,

Regards, Chris
0 Likes
Accepted solutions (1)
1,715 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

 

Dear Chris,

 

Thank you for your report.

 

For the sake of other readers, I typed put the text displayed in the screen shot of the message box that you attached:

  

  Model Upgrade
  Your model is being upgraded
  From: Autodesk Revit Architecture 2012
  To: Autodesk Revit 2018
  When the upgrade is complete, save the model 
  to avoid the need to repeat the process.
  [Cancel button greyed out]

   

Please take a look at the issue raised in this other recent thread:

 

https://forums.autodesk.com/t5/revit-api-forum/sdk-uiapi-drag-and-drop-stopped-working/m-p/7694728

 

I raised an issue REVIT-125399 [UIAPI SDK sample drag and drop fails -- 13796456] for that with the development team that they are currently researching.

 

Could that be the same issue you are facing?

 

Otherwise, I'll have to raise a new issue for this for you.

 

Can you provide a minimal reproducible case for me to share with the development team?

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 4

IconSystem
Enthusiast
Enthusiast

Hi Jeremy,

 

Thanks for the clarity for the link you provided.

 

I have now narrowed down the issue to this api method:

PromptForFamilyInstancePlacement()

 

I was able to see that this api command has an issues as shown in the comment section of the api docs:

http://www.revitapidocs.com/2015/b05a17df-3f63-9172-8e49-d2e1e6b8e9e2.htm 

 

Any confirmation that there is an existing issue for this api function in 2018?

If so is there an alternative method that can be used for 2018?

 

Appreciated,

Regards, Chris
0 Likes
Message 4 of 4

IconSystem
Enthusiast
Enthusiast
Accepted solution

Brief update:

 

Have been able to sort out the issue:

The problem had to do with the  PromptForFamilyInstancePlacement() api method which has new behaviour as of Revit 2018 onwards. 

 

The following blog post contains useful info on handing the exception caused by the method:

http://thebuildingcoder.typepad.com/blog/2017/05/prompt-cancel-throws-exception-in-revit-2018.html

Regards, Chris
0 Likes