Metered Licensing

Metered Licensing

Here are the simple steps to use the Metered class.

  1. Create an instance of Metered class.
  2. Pass public & private keys to SetMeteredKey method.
  3. Do processing (perform task).
  4. call method GetConsumptionQuantity of the Metered class.
  5. It will return the amount/quantity of API requests that you have consumed so far.

Following is the sample code demonstrating how to set metered public and private key.

import aspose.cad as cad
// Access the setMeteredKey property and pass public and private keys as parameters
Aspose.CAD.Metered.SetMeteredKey("PublicKey", "PrivateKey");
// Get metered data amount before calling API
amountbefore = cad.Metered.get_consumption_quantity()
// Display information
print("Amount Consumed Before: " + amountbefore.ToString());
// Do processing
image = cad.Image.load("file.dwg");
// Get metered data amount After calling API
amountafter = cad.Metered.get_consumption_quantity()
// Display information
print("Amount Consumed After: " + amountafter);