How save datas using macro(API)?
How save datas using macro(API)?
(OP)
Welcome,
Does anybody know how save in simply text file some datas(for exemple: Selected Edge,Center of selected surface, or Area of selected surface) from part created in Solidworks using macro(API)?
Does anybody know how save in simply text file some datas(for exemple: Selected Edge,Center of selected surface, or Area of selected surface) from part created in Solidworks using macro(API)?






RE: How save datas using macro(API)?
See the Open statement in VBA help.
SA
RE: How save datas using macro(API)?
RE: How save datas using macro(API)?
I have to add that I'm beginner in VBA.
Thanks for any help!
RE: How save datas using macro(API)?
You can also try looking in the Main Menu/<same as above>/Visual Basic (VB) Examples/L - Q/Mass Properties/... section.
For creating Text files, you'll have to use the VB Help. Try looking up Open, Input, or Line Input for some examples. If you don't have any luck then try searching the Internet for 'How to create text files from Excel VBA'. There are a lot more Excel examples available than SolidWorks about how to do non-SolidWorks specific tasks with VBA. You should be able to copy and paste most of that example code directly into a SolidWorks macro.
Ken
RE: How save datas using macro(API)?
http://www.eng-tips.com/userinfo.cfm?member=picia
Good luck!
RE: How save datas using macro(API)?
To create the text file, look up how to use "FileSystemObject" on the web. Here's a start:
http:
You will have to add the library "Microsoft Scripting Runtime" under References to get the FSO object to become available.
RE: How save datas using macro(API)?
Your macro you showed picia is just what I need for a future project. Saved me a lot of work. A star for you.
Bradley
SolidWorks Premim 2007 x64 SP3.1
PDM Works, Intel(R) Pentium(R) D CPU
3.00 GHz, 4 GB RAM, Virtual memory 12577 MB, nVidia 3400