Jump to content

Macro to divide a curve in a lot of points


Recommended Posts

Posted

Hi guys, I am a beginner of solidworks api and I should build a macro that can divide a curve (line, arch, spline, etc...) in a number of points (decided by me) equally spaced. Could you help me? Thanks a lot

Posted

Thanks but I need to know ho I can use in SolidWorks. Do you know something about it?

Posted (edited)

Have you posted this question at the Solidworks forum over at Dassault Systemes?

 

Would that be the same as creating points at a curve's intersections?

Edited by ReMark
Posted
Thanks but I need to know ho I can use in SolidWorks. Do you know something about it?

 

It is almost always better to pattern a feature rather than a sketch in a parametric modeler.

What is it exactly that you are trying to pattern (attach your sldprt file here)?

 

Insert>Feature>Pattern>Curve Driven Pattern

Posted (edited)

I am trying to divide a curve in several points. I have a 3D sketch in which I created a trajectory. Now I am trying to create a macro that is able to divide this trajectory in a number of points (for example 100) decided by me.

I post the SLDPRT file to give you an example of what is the trajectory.

 

Parte1.SLDPRT

 

 

I have already begin to write the macro but I am not able to write the function (inside my macro) that divide my trajectory in n points.

Edited by goniz88
Posted
Have you posted this question at the Solidworks forum over at Dassault Systemes?

 

Yes but I did'nt recieve any answers!:(

 

Would that be the same as creating points at a curve's intersections?

 

It could be similar, but I need to create several ponts (like a pattern along the curve)

Posted

Unless you have other ideas in mind you really don't need a macro for this. Below is the procedure for creating evenly spaced points on a curve.

 

Step1- Edit your 3d sketch. Select Tools/Spline Tools/Fit Spline. Select all sketch entities. Uncheck closed spine in property manager and click ok. Exit sketch.

Step2- Select Insert/Reference Geometry/Point. Under reference entities select the curve we created in step1. Select icon named "Along curve distance or multiple reference point". Select evenly distribute and enter the desired number (100 in your case). Click ok.

 

Points have been evenly distributed on selected curve. Hope this helps.

Posted
Unless you have other ideas in mind you really don't need a macro for this

 

 

I know that SolidWorks can do this without a macro, but I need to write a macro because my macro has to do a lot of things: one of these things is "divide a curve in a number of points".

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...