1. There is no easy way to set the Detail ID through the API. The intent is that Detail ID always comes from the CAD file. The only way to change the value is to check out the CAD file, check it in with an updated BOM object, and update the item. It's a complecated workflow, and I don't usually recommend it.
2. I wouldn't expect the "weight" to get cleared in the workflow you mentioned. Is "weight" a mapped property?
3. There is nothing you can do in your restriction code. However I would like to know more about the workflow. What are the steps to reproduce? Does the user have the option to exit mid-way through, or are they forced to click OK on each dialog?
Thank you for your reply.
1. I think it's good for customer to update their Detail IDs only by update their CAD files when they use Inventor or AutoCAD Mechanical or such software else, but there are some customers using vanilla AutoCAD with no BOM information in their drawings at all, and using excel to import bom structures into vault. So there is no way to get Detail ID populated in vault from CAD files in such situation, let alone to change them, is that right?
2. yes, Weight is mapped from title block. so if we update item, the weight property will get the empty value from title block, and we don't want this happen.
3.the situation is we create a restriction that if user want to add a duplicated file into vault (same file for different project), the add action will be cancelled and a link will be created instead. When user drag a folder of files (there may be lots of duplicated file names) into vault, of course the restriction message box will show many times, user can select yes to continue or no to abort and if they want to continue, they will have to keep clicking yes.
1. Correct there is no way to set the Detail ID in this way.
2. This goes back to the classic programming issue of what to do with empty data. In some cases you want to set the property to blank and some cases where you want to ignore the property.
Vault is coded to black the property. There is no way to change this behavior.
Does the drawing's title block show the weight property with a blank value?
3. This sort of thing happens with events. The parent app isn't expecting this sort of thing to go wrong, so it doesn't collect up all the restrictions. I'll log this case, but there are probably many more.
The event mechanism lets you restrict an opreation, but it wasn't intented to let you replace the operation with something else. You might be better off just providing your own "copy folder" command to do the copy you want and leaving the restrictions in place for the decault copy command.