EPDM assigned number and datacard

I am thinking to create macros on some standard parts (e.g. an assembly of a door with sensors). I can handle the part creation, but not sure how to handle the EPDM.

To what I understood, my current system asks EPDM for a serial number when we save a part to EPDM. At the same time, a datacard will be opened. Is there some way that I can get 4 numbers form the EPDM and bypass the open of datacard?

Thanks

SolidworksApi macros