Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro for inserting multiple curves?

Status
Not open for further replies.

rustynissan

New member
Dec 2, 2008
24
I have XYZ coordinates for several curves that represent cross-sections of a part I would like to loft through. Around 25 curves containing about 65 points each need to be imported. I could make separate text files for each curve, but is there a way to do it with one excel file (possibly with each curve definition on a new sheet)?

Is this possible? I am new to the SW API, although I have used VBA in Excel a little bit.
 
Replies continue below

Recommended for you

If you only have 25 curves it'll probably be quicker to import one at a time than to write a macro to do it automatically.

That said, if it's 25 curves for or five times a week then that might be macro territory.

-handleman, CSWP (The new, easy test)
 
Indeed. This is something that will have to be updated periodically and would benefit from use of a macro.
 
This macro generates curves/surfaces in Excel and imports them into SW. It's not exactly what you're looking for, but you can use it as a starting point for your macro. Most of the code you'll need is already there: calling excel, reading spreadsheet values, creating curves, etc.
 
 http://files.engineering.com/getfile.aspx?folder=9a1e83c2-a469-4e3f-a78e-8b34e03f5b17&file=SurfPlot.zip
Status
Not open for further replies.

Part and Inventory Search

Sponsor