Unfreeze parts by PDM task

Hi Folks

I need some help to develop a macro that must unfreeze all selected parts using a PDM task.

I tried this scrip from this link bellow

https://forum.solidworks.com/message/908348

But it only works with opened parts. It does not support SolidWorks pdm prof tasks.

Can someone help me with that?

Regards.

SolidworksApi/macros