Könnten Sie mir bitte helfen.
Sorry, dass ich dich nicht auf deutsch anspreche.
I have a problem with the labeling action, when using the own action,
sorting order is ignored, but filtering works fine.
This action works fine for Reports, but doesn`t work completely for Labeling.
although the manual says:
https://www.eplan.help/en-US/infoportal/content/api/2.8/API_LABELING_MODIFICATION.html
"
If an action by this name is registered in EPLAN, it is called during label generation.
With the action, you can influence the objects, which are reported and the ORDER in which they appear.
"
example of action:
class SortAction : IEplAction
{
public bool Execute(ActionCallingContext oActionCallingContext)
{
string mode = "";
string objects = "";
oActionCallingContext.GetParameter("mode", ref mode);
oActionCallingContext.GetParameter("objects", ref objects);
if (mode == "ModifyObjectList")
{
List<string> objectsList = objects.Split(';').ToList();
var rnd = new Random();
objectsList = objectsList.OrderBy(item => rnd.Next()).ToList();
oActionCallingContext.AddParameter("objects", String.Join(";", objectsList));
}
return true;
}
public void GetActionProperties(ref ActionProperties actionProperties)
{
throw new NotImplementedException();
}
public bool OnRegister(ref string Name, ref int Ordinal)
{
Name = "rnd";
Ordinal = 20;
return true;
}
}
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP