That's not so easy. But I'll give you the solution anyway in case you are the adventurous type.
The attachments aren't actually "attached" until after the content created/updated events have happened (internal ips workflow thing). So you can't check the condition on a rule attached directly to one of those events because the attachment won't actually have been claimed yet. Also, there is no stock condition to check if a topic or post has an attachment, so it would require a custom php snippet to do that.
So... for the solution:
You need to first create a custom action which you will trigger from a rule when the content is created/updated and set the action execution to wait until the end of the page load so that the "attachment" can be processed before your custom action is actually fired. And then you would check the condition in your custom action rule.
The custom php code portion of the condition would look like this (this means you need to add an argument to your custom action called "Content", which would either be a content item class or a content comment class, and would make $content available to your custom php code):
/**
* If content being checked is a topic/item, check if any post has an attachment
*/
if ( $content instanceof \IPS\Content\Item )
{
$locationKey = $content::$application . '_' . ucfirst( $content::$module );
return (bool) \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1=?', $locationKey, $content->activeid ) )->first();
}
/**
* If content being checked is a post, see if it has an attachment
*/
else if ( $content instanceof \IPS\Content\Comment )
{
$item = $content->item();
$locationKey = $item::$application . '_' . ucfirst( $item::$module );
return (bool) \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1=? AND id2=?', $locationKey, $item->activeid, $content->activeid ) )->first();
}
return FALSE;