Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Navigation
- Solid Edge
- Forums
- Blogs
- Knowledge Bases

- Siemens PLM Community
- Solid Edge
- Solid Edge Developer Forum
- Macro for exporting a curve coordinates to excel

Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-20-2016 03:40 AM

Hello!

Since I have no experience with programming, I hope that someone here on the forum can help me with this problem.

I would need a x,y,z coordinates of a Solid Edge curve exported to Excel.

1. curve is created with any kind of curve command (curve in sketch, keypoint, intersection, project, cross, etc.)

2. reference coordinate system is created by the user

3. x,y,z coordinates of curve, according to this reference coordinate system should be exported to excel

How I think, such a macro should work:

1. user is selecting this new macro/command

2. user is now selecting one curve or all curves

3. user can select the number of points on the curve. At least 500 points should be exported. If more curves are selected, then every curve has the same number of points.

4. point should be equaly distributed along the curve

5. now, xyz coordinates are exported to Excel

Format of exported curves in Excel:

1. cell A1 is name of the curve (name of the curve in Pathfinder)

2. from second row on there are xyz coordinates (first column is x, second column is y and third is z column)

3. all exported curves are copied in the same sheet. So, after the last coordinate, new curve is written (first the name of the curve, then all the coordinates).

If this is possible to create, I would really appreciate.

If it is to much work to do for such a macro and can not be created for free, let me know.

Thanks.

Kind Regards.

15 REPLIES 15

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-20-2016 04:41 AM

My main concerns are about your point 4.

I had a look at SDK and it seem to be possible, but it will need some time to develop it correctly.

Eventually PM me for further infos.

Francesco

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-20-2016 11:30 PM - edited 06-20-2016 11:30 PM

I have done this before. It's a piece of cake.

Can make the macro both free (for personal use) and paid (if you are a reseller).

~Tushar

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-21-2016 02:58 AM

I had a look at the APIs and wonder how do you populate the curve collection to use the GetParamAtLenght method.

Thanks

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-22-2016 03:10 AM - edited 06-22-2016 03:17 AM

Solid Edge API help is of little or no use.

Generally, I look up Solid Works on line API help for general understanding and the plentiful examples since these basic curve functions are almost similar in name and behavior.

I think Param is the range of the curve from 0 to 1

and this function is used to calculate the length of a segment of the curve over a range of two params - starting and ending.

for e.g. length of segment between params 0.26 to 0.82 which roughly correspond to 26% and 82 % of the length.

Other similar functions are Evaluate, GetLengthAtParam, GetParamAtPoint, GetPointAtParam, etc. of which I find myself using the last one more frequently.

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-22-2016 03:13 AM

Thanks

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-22-2016 03:26 AM

Hello Francesco:

I am sorry about not being able to understand the question correctly.

Where is the curves collection argument ?

For KeyPointCurve, the closest function is GetAllPoints and it does not seem to return 500 points as expected in Pt. (3) of the initial post.

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-22-2016 04:34 AM

I then found the GetPointAtParam being part of Edge objects that I can found in the construction bodys.

Now I need a way to find what edge belong to a specific KeyPointCurve feature.

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-22-2016 09:07 AM - edited 06-22-2016 09:07 AM

@Tushar said:

"Solid Edge API help is of little or no use.

Generally, I look up Solid Works on line API help for general understanding and the plentiful examples since these basic curve functions are almost similar in name and behavior."

Is that not a sad commentary?

Bruce Shand

SE2019 MP5 - Insight - Win10 - K4200

SE2019 MP5 - Insight - Win10 - K4200

Re: Macro for exporting a curve coordinates to excel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-22-2016 11:50 AM

I am looking up the meaning of the phrase "sad commentary" on Google but no results so far.

We rarely use that combination of words in this part of the English speaking world.

Yes, it does make me feel sad when the API help proves to be of little or no help.

What is the meaning of the phrase you used ?

- Tags:
- API
- commentary
- sad

Download the **latest maintenance pack** from GTAC.

Follow Siemens PLM Software

© 2019 Siemens Product Lifecycle Management Software Inc