Is there a way to create and trigger custom generic event via SDK, We can see this link to tigger some generic events https://github.com/milestonesys/mipsdk-samples-protocol/tree/main/TriggerGenericEvent But would good to know how to create a and trigger generic events using SDK
Generic Events are special events that trigger by matching and ascii string sent on a port.
Generic Events are not supported by using the MIP Library, at least have no commands in the MIP library, so the way to use involves sending string via TCP or UDP. (As ilustrated by the samples you found.) Internally, behind the scenes, the Generic Events are converted to User-Defined Event in the Milestone servers.
And this leads me to my recommendation: Use User-Defined Events (or Analytics Events) instead, they are safer as they require a login and they are fully integrated and supported by the MIP library.
On how to trigger a User-Defined event is recommend exploring the Config Access via SDK sample and the trigger button in that sample.
https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configaccessviasdk/readme.html&tree=tree_2.html