HELP ON MAKING A SPLINE OUT OF A POINT LIST

I am trying to make a program that will automatically draw gears based on
basic parameters fed to it and I've come across a problem. Now that I
have a point list, how can I make a spline out of it. What I'm doing now
is very convoluted, I am setting up a selection set and a loop that will
draw a segment of the line for each loop and add it to that selection set
After that I use the pedit command to join the line segments and convert
them into a spline.
Also has anybody had problems with trying to use trim through Autolisp,
sometimes the trim works and sometimes it doesn't (check that out for
yourself) Even though the point I feed it resides on a line that I want
to trim nothing happens.
Thank You
This is a bit of code from the lisp file
;========================================
DRAWING THE CURVE
(setq curv (ssadd)) ; CREATE A CURVE HOLDING SELECTION SET
(setq index 0)
(repeat (length endpoints) ; WILL MAKE A WHOLE BUNCH OF LINE
SEGMENTS, AND ADD EACH OF THEM TO THE CURV SELECTION SET
(command ".line"
(nth index endpoints) ; GET THE CURRENT ENDPOINT AS THE
START OF THE LINE
(nth (1+ index) endpoints); GET THE NEXT ENDPOINT AS THE EP OF
THE LINE
""
)
(ssadd (entlast) curv) ; ADD THE LAST CREATED LINE TO THE
SELECTION SET
(setq index (1+ index))
)
(cond
(
(> bc rd) ; IF THE BASE CIRCLE IS LESS THAN THE
ROOT DIAMETER
(command ".line"
(last endpoints) ; START FROM THE END OF THE INVOLUTE
(polar center (: 0) (/ rd 2.0))
; AND TO THE ROOT DIAMETER
""
)
(ssadd (entlast) curv) ; ADD THE LAST ENTITY CREATED TO THE
CURV SS
)
)
(command ".pedit" "m" curv "" "y" "j" "" "s" "")
; CONVERT THE LINES GRABBED IN THE SELECTION
SET INTO A SPLINE USING THE POLYLINE EDIT COMMAND

(COMMAND ".CIRCLE" center "d" rd) ; CREATE THE ROOT DIAMETER TO TRIM
THE CURVE TO
(command ".trim" ; TRIM THE INVOLUTE CURVE UP THE ROOT
DIAMETER
(polar center (: 13.45) (/ rd 2.0))
""
(last endpoints)
""
)
Reply to
A.r.a.k.h.N.i.d.e.F
Loading thread data ...
"A.r.a.k.h.N.i.d.e.F" wrote in news:Xns9484C7737C29AMYEMAILBongcom@24.168.128.86:
by the way sorry for the caps heading didn't notice it until now.
Reply to
A.r.a.k.h.N.i.d.e.F
do a google search for autogear.lsp & save your time for better things
Reply to
Alan Williamson

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.