EBDN - Community - Question & Answers

  Saturday, 10 October 2020
  4 Replies
  1.1K Visits
0
Votes
Undo
HI,
I need to drop a prrefed master shape in sheet ,firstly I use the "Sheet.Open(SheetOpenBehavior.AutoSave);"when finished drawing ,there is nothing on sheet . then I changed the open type to " newSheet.Open(SheetOpenBehavior.Visio );" I can see the symbol was drawing on sheet but the sheet is readonly model ,if i close the sheet the symbol will gone.
I attached the code

public static void DropSymobl(string sSymbolName, Sheet oSheet, double dx, double dy, ObjectItem oObject = null)
{
if(oSheet.IsOpened==false)
{
oSheet.Open(SheetOpenBehavior.AutoSave);
}
IList<ExecuteSheetOperationRecordData> data = new List<ExecuteSheetOperationRecordData>()
{
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.OpExecSheetDropSymbol
},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetRef2Master,
Value=sSymbolName

},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetPosX,
Value=dx
},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetPosY,
Value=dy
},
new ExecuteSheetOperationRecordData()
{
Qualifier=(int)ExecuteSheetOperationModes.ArgExecSheetRef2Obj,
Value=oObject.Id
}


};

oSheet.ExecuteSheetOperation(ref data);

}

Is there anything wrong with it ? my version is EB2020 R2(6.9.1) Build(130).