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. This method only try to repair the specified broken Data Shortcut.
Namespace: Autodesk.Civil.DataShortcuts
Assembly: AeccDataShortcutMgd (in AeccDataShortcutMgd.dll) Version: 13.8.0.280
Syntax
C#
public bool RepairBrokenDataShortcut( int index, string targetDwgFullPath )
VB
Public Function RepairBrokenDataShortcut ( index As Integer, targetDwgFullPath As String ) As Boolean
C++
public: bool RepairBrokenDataShortcut( int index, String^ targetDwgFullPath )
Parameters
- index Int32
- Specify an index of Data Shortcut in the current Data Shortcut project.
- targetDwgFullPath String
- File full path as the new source drawing.
Return Value
BooleanReturns the repairing result.
Example
API user should check the Data Shortcut's status before repairing it.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); 13 } 14 }