This method is used to repair the broken Data Shortcut.
A broken Data Shortcut is the one which source drawing or source entity can not be found.
If autoRepairOther == true and the specified broken Data Shortcut can be repaired successfully, we will try to repair all other broken Data Shortcuts with the same source drawing.
Namespace: Autodesk.Civil.DataShortcutsAssembly: AeccDataShortcutMgd (in AeccDataShortcutMgd.dll) Version: 13.4.2516.0
Syntax
C# |
---|
public bool RepairBrokenDataShortcut( int index, string targetDwgFullPath, bool autoRepairOther ) |
Visual Basic |
---|
Public Function RepairBrokenDataShortcut ( _ index As Integer, _ targetDwgFullPath As String, _ autoRepairOther As Boolean _ ) As Boolean |
Visual C++ |
---|
public: bool RepairBrokenDataShortcut( int index, String^ targetDwgFullPath, bool autoRepairOther ) |
Parameters
- index
- Type: System..::..Int32
Specify an index of Data Shortcut in the current Data Shortcut project.
- targetDwgFullPath
- Type: System..::..String
File full path as the new source drawing.
- autoRepairOther
- Type: System..::..Boolean
This indicates whether to repair other broken Data Shortcuts or not.
Return Value
Returns the repairing result.
Examples
API user should check the Data Shortcut's status before repairing it.
CopyC#

1DataShortcuts.SetWorkingFolder(@"F:\DSWorkingFolder"); 2DataShortcuts.SetCurrentProjectFolder("ProjBroken"); 3DataShortcuts.Validate(); 4bool isValidCreation = false; 5var shortcutMgr = DataShortcuts.CreateDataShortcutManager(ref isValidCreation); 6int numOfItems = shortcutMgr.GetPublishedItemsCount(); 7for (int index = 0; index < numOfItems; index++) 8{ 9 var item = shortcutMgr.GetPublishedItemAt(index); 10 if (item.IsBroken) 11 { 12 shortcutMgr.RepairBrokenDataShortcut(index, sourceDwg, true); 13 } 14 }