This part of code gives error
(setq pp (getpoint "/nPick internal Point: "))
(vl-cmdf "-bhatch" "Properties" "solid" "advance" "island" "yes" "S" "outer" "" pp "")
(setq ph (entlast))
(setq pa (/ (vlax-get-property (vlax-ename->vla-object (entlast)) 'Area) 1000000))
attached polyline which gives error.