Hi Mohamed,
You need to do this using a function. For example, see below for code that removes the background fill of region objects; hopefully this helps.
Update polygonSelection Set obj = removeObjBckGrnd(obj)
Function removeObjBckGrnd(ByVal oOverlayPoly As Object) As Object
' PRE:
' - oOverlayPoly is a polygon object
' POST:
' - Returns an object that is the same as the input object except that if a background was in existence it has now been removed
Dim oNewObj As Object
Dim brushPoly As Brush
Dim nBrushPattern As Integer
Dim nBrushForeColour As Integer
Dim nBrushBackColour As Integer
Dim brushNew As Brush
' Retrieve the current brush
brushPoly = ObjectInfo(oOverlayPoly, OBJ_INFO_BRUSH)
' Retrieve current brush attributes
nBrushPattern = StyleAttr(brushPoly, BRUSH_PATTERN)
nBrushForeColour = StyleAttr(brushPoly, BRUSH_FORECOLOR)
nBrushBackColour = -1 ' Transparent background required
brushNew = MakeBrush(nBrushPattern, nBrushForeColour, nBrushBackColour)
oNewObj = oOverlayPoly
Alter Object oNewObj Info OBJ_INFO_BRUSH, brushNew
removeObjBckGrnd = oNewObj
End Function