Dear Yanhua,
I tried to email two examples from our website (
http://www.solidworks.com/pages/services/APISupport.html). But the email was rejected. You can go the website and download the examples.
Unfortunately, all the Attributes examples are in VB. However, they should give you an idea of how to use Attributes.
There are also two VB examples in our documentation.
Regards,
Robin Richter