EBDN - Community - Question & Answers

  Tuesday, 09 March 2021
  0 Replies
  829 Visits
0
Votes
Undo
I need to delete the symbol which Droped by using aucOpExecSheetDropSymbolFromSheetViaDropPoint functions, My code is like below,but nothing happened
Is there anything wrong ? How to get the DO-OID of the circuit components master? I try to get the DO-OID from the aucOpExecSheetDropSymbolFromSheetViaDropPoint functions, but it still not work.

public override void Run(Application myApplication)
{
Sheet tagsheet = myApplication.Selection[0].Project.DrawingsFolder.Children[0] as Sheet;
Sheet suoce = myApplication.Selection[0].Project.DrawingsFolder.Children[1] as Sheet;
tagsheet.Open(SheetOpenBehavior.AutoSave);
suoce.Open(SheetOpenBehavior.AutoSave);
string sID= Comm.DropSybolInDropoint(suoce, tagsheet, "3");
Comm.DeleteSymbolWithDropPoint(tagsheet, "3",sID);
Forms.MessageBox.Show("完成");

}

public static string DropSybolInDropoint(Sheet suoceSheet,Sheet targetSheet,string dropName)
{
IList<ExecuteSheetOperationRecordData> data = new List<ExecuteSheetOperationRecordData>()
{
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.OpExecSheetDropSymbolFromSheetViaDropPoint
},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetRef2Sheet,
Value=suoceSheet.Id

},
new ExecuteSheetOperationRecordData()//ArgExecSheetDropPoint
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetDropPoint,
Value=dropName
},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetRetVal

}



};
targetSheet.ExecuteSheetOperation(ref data);
return data[3].Value.ToString();
}
public static void DeleteSymbolWithDropPoint(Sheet targSheet,string dropintName,string doID)
{
IList<ExecuteSheetOperationRecordData> data = new List<ExecuteSheetOperationRecordData>()
{
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.OpExecSheetDeleteSymbolDP
},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetDropPoint,
Value=dropintName

},
new ExecuteSheetOperationRecordData()//ArgExecSheetDropPoint
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetRef2Symbol,
Value=doID
}
};
targSheet.ExecuteSheetOperation(ref data);
}