API ServiceButtonItem.ItemPath displays "Unable to Open File" dialog

mszanto
Enthusiast

API ServiceButtonItem.ItemPath displays "Unable to Open File" dialog

mszanto
Enthusiast
Enthusiast

I'm using the Fabrication API in Fabrication CADmep 2020 to update thousands of ServiceButtonItem ItemPaths because the ITM files have been moved to new folders. When I set the ServiceButtonItem.ItemPath to the new ITM location, a dialog pops up (see below) indicating the ITM file can't be found at the old location. 

There are a number of reasons why this is bad...

 

1. First and foremost, an API call should never result in a dialog being displayed. It interrupts our code and there is no viable workaround.

2. Why is the original path even being checked? If I'm changing the ItemPath, I know its incorrect.

3. Because the dialog keeps popping up, the user will have to click OK thousands of times.

 

The only work-around that I can think of is to temporarily copy the ITM file from the new location to the old location, then delete it after I've reset the ItemPath. This presents other challenges because the folder may no longer exist, and if I create it, I have to add logic to remove the entire folder chain when I'm done. This means I have to check every folder in the old path to see if it is empty before removing it. That's a pretty crappy workaround.

 

Autodesk, can you please verify this bug.

Also, another member of my team, Gregor Vilkner posted a couple of other issues in the API a few weeks ago and there has been no response.

 

thanks,

 

mike

 

 

mszanto_0-1592421054750.jpeg

 

 

 

0 Likes
Reply
524 Views
2 Replies
Replies (2)

nathan.chapman
Collaborator
Collaborator

A service button allow more than one ITM mapped to it.  My assumption is that, the original path still exists but you are then assigning a new itm.  This would produce the warning your getting.  I'm away from my computer for a while so cant test this out.  Run it on a button and see if you see multiple paths to itms.

Nathan Chapman
Production Manager at General Heating and Air Conditioning

Revit Architecture Certified Professional
Revit MEP Mechanical Certified Professional
Revit MEP Electrical Certified Professional
DynaFabrication Package Author

Was this answer helpful? If so, please click the ACCEPT AS SOLUTION or the KUDOS button.
0 Likes

craigjonnson
Collaborator
Collaborator

I know you are trying to do this through the API. Have you also considered the button repair tool and using excel to rename all of your folder paths? While this is not a solution to your issue. it could pose a solution to the original problem.

0 Likes