Author Topic: Direct a line along a spline or curved Polyline  (Read 1744 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 827
Direct a line along a spline or curved Polyline
« on: July 08, 2012, 01:38:24 PM »
Hello everyone .

How can I copy or create a line along a spline or curved polyline with respect to the rotation of the angle ?

I prefer it with code and not commands please .

My main problem is with the rotation of the curve . :-(

Many thanks .  :-)

« Last Edit: July 08, 2012, 01:55:01 PM by coder »

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: Direct a line along a spline or curved Polyline
« Reply #1 on: July 08, 2012, 01:53:46 PM »
Use the vlax-curve-* functions to determine the point at a specific distance and first derivative (direction of the tangent) at such point.

e.g.:
Code - Auto/Visual Lisp: [Select]
  1. (setq pnt (vlax-curve-getpointatdist <entity> <distance>))
  2. (setq ang (angle '(0.0 0.0 0.0) (vlax-curve-getfirstderiv <entity> (vlax-curve-getparamatpoint <entity> pnt))))

Coder

  • Swamp Rat
  • Posts: 827
Re: Direct a line along a spline or curved Polyline
« Reply #2 on: July 08, 2012, 02:21:32 PM »
Thanks Lee , That's works great .  :-)

Can I ask you why you have started  the angle from '(0. 0. 0.) to the derivation ?

Any extra information about the meaning of derivation would be certainly thankful  :-D

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: Direct a line along a spline or curved Polyline
« Reply #3 on: July 08, 2012, 02:25:34 PM »
Thanks Lee , That's works great .  :-)

You're welcome  :-)

Can I ask you why you have started  the angle from '(0. 0. 0.) to the derivation ?

Any extra information about the meaning of derivation would be certainly thankful  :-D

Because the first derivative (tangent vector) is expressed in WCS relative to the origin (0.0 0.0 0.0)

For more information: First Derivative