Bolt Length Macro

I can get a bolt length by typing a command like ' Q P1 BOLT 1 BLENG' at a flange point. However, I am encountering an error in my macro as shown below.

*** Macro****

!sData1 = P1 BOLT BLEN OF $!nBranmem

*** Error Message ****
(2,260) PPoint attribute is not valid in this context
In line 88 of Macro C:\pdmsuser\pdm\pml\[Final]Conlist

Please advise me on how to resolve this issue.