No, that doesn't work.
Direct X functions can only be used via certain (material) events or by initializing your own D3DInstance.
(Have a look to draw_begin or Gamestudio SDK ->Plugin SDK-> Using Direct3D functions).