woutervddn Posted July 28, 2010 Share Posted July 28, 2010 hi, I'm working on a program that would automate the drawing of a curve. Normally you would use spline command and put where you want your points to be. Now the problem is that the amount of points can vary. I used this code: ' Define the extrusion path (spline object) Dim splineObj As AcadSpline Dim startTan(0 To 2) As Double Dim endTan(0 To 2) As Double Dim fitPoints(0 To snggeg) As Double snggeg is the amount of points that I need. After this part I start putting the values in the fitpoints & then I draw the spline. but he keeps saying (about snggeg): "compile error: constant expression required." That's a problem! Any ideas about how to fix it? I could do it with an if and go make the fitpoints from 0 to 2, from 0 to 5, from... only problem is that we might need 500 points sometimes. so that are 500 ifs, which doesn't sound fun to me.. Pls let there be someone with a solution cause I've allready spent WAY to much time on this problem Thanks in advance Wouter Quote Link to comment Share on other sites More sharing options...
SEANT Posted July 28, 2010 Share Posted July 28, 2010 Unknown quantites are usually dealt via Dynamic Arrays. Dim fitPoints() As Double Dim fpCount as Integer Dim fpCountBound as Integer Once fpCount count is known, for instance, then: fpCountBound = (fpCount * 3) - 1 Redim fitPoints(fpCountBound) Quote Link to comment Share on other sites More sharing options...
woutervddn Posted July 30, 2010 Author Share Posted July 30, 2010 thanks a lot! I'll try it right away.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.