Lee Mac Posted January 18, 2009 Share Posted January 18, 2009 Hi Guys, Hope everyone is enjoying their Sunday. Was just trying to learn some VL and came across the "start point" and "start param" fuctions. Was just wondering - what is the difference between a start point and start parameter? The reason I ask is this: I was trying to get the length of a curve and didn't know whether to do this: [color=Green][b](setq ent (car (entsel)) dis (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent)))[/b][/color] Or this: [b][color=Green](setq ent (car (entsel)) dis (vlax-curve-getDistAtPoint ent (vlax-curve-getEndPoint ent)))[/color][/b] Also, do the entities (enames) need to be turned into VLA objects? Possibly like this? [b][color=Green](setq vlent (vlax-ename->vla-object ent))[/color][/b] Many thanks for your help! Quote Link to comment Share on other sites More sharing options...
lpseifert Posted January 18, 2009 Share Posted January 18, 2009 I hope I've got this right, I've never seen any documentation; someone correct me if I'm wrong The parameter of a vlax-curve is the vertex number (kinda). The start parameter of the first vertex (start of curve) is 0. The ParameterAtPoint of the next vertex is 1 (similarly vertex 3= parameter 2...). The ParameterAtPoint of the point midpoint (on the curve) between vertex 1 (parameter 0) and vertex 2 (parameter 1) is 0.5; 3/4 of the way between vertex 2 and 3 would be 1.75. getStartPoint returns the coordinates of the beginning of the curve. AFAIK you need to convert the entity to a vla-object prior to using the vlax-curve functions. I'd probably use something similar to this to return the total length of a vlax-curve (vlax-curve-getDistAtpoint vlent (vlax-curve-getEndPoint vlent)) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 18, 2009 Author Share Posted January 18, 2009 Excellent! Thanks for your help and explanations lpseifert. I understand the parameter functions much better now - it divides the curve into segments using the vertices. Nice. And thank you for providing me with the code. Cheers Lee Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 18, 2009 Author Share Posted January 18, 2009 ...AFAIK ... Sorry, but what is the meaning of this? Quote Link to comment Share on other sites More sharing options...
lpseifert Posted January 18, 2009 Share Posted January 18, 2009 As Far As I Know Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 18, 2009 Author Share Posted January 18, 2009 As Far As I Know Haha, of course. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted January 18, 2009 Share Posted January 18, 2009 Here is a thread that gave me some insight on the use of parameters. http://www.theswamp.org/index.php?topic=23951.0 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 18, 2009 Author Share Posted January 18, 2009 Thanks lpseifert, it appears CAB is more famous than I thought :wink: Quote Link to comment Share on other sites More sharing options...
SEANT Posted January 19, 2009 Share Posted January 19, 2009 To expand a bit on “Parameter”; lines and polylines appear to share the trait that the startpoint is at Parameter = 0. Entities such as Circles, Arcs and Ellipse have a parametric range that fall within 2Pi. For example, an arc centered at 0,0 with a startpoint 0,10 and endpoint -10, 0, would have a parametric range 1.5708 to 3.1416. For the most part, splines created with AutoCAD would have a parametric range defined at creation, equal to the distance between all of its “FitPoints”. The reason I say defined at creation is because if the Spline were subsequently scaled, the parametric range would remain constant. But, like Arcs and Ellipse, the spline’s range would become truncated if trimmed. Consequently, the spline’s Startpoint may be at a Start Parameter other than 0. I have no direct experience with any of the vlax-curve function but believe they’re derived from ARX AcGeCurve class methods. If that is indeed true then they would likely have the same characteristics as found in Managed Class (.NET). Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 19, 2009 Author Share Posted January 19, 2009 Thank you very much SEANT for your clarification in this matter - a parametric range of 0-2pi for circles and arcs and ellipses makes sense. I must say you are a knowledgeable being indeed - are you conversant in LISP, VBA and .NET? Quote Link to comment Share on other sites More sharing options...
ASMI Posted January 19, 2009 Share Posted January 19, 2009 I would like to add that the value of Parameter for the circle is not limited to 2pi and possible any values including negative (for example -1002.56). You can just be on the circumference of a multiple pi to walk in a circle. Some programs need to verify that the current value of the Parameter is not greater than its value in the end point (2pi). Quote Link to comment Share on other sites More sharing options...
SEANT Posted January 19, 2009 Share Posted January 19, 2009 Thank you very much SEANT for your clarification in this matter - a parametric range of 0-2pi for circles and arcs and ellipses makes sense. I must say you are a knowledgeable being indeed - are you conversant in LISP, VBA and .NET? Actually almost no lisp, and fairly new to .Net. I have done some programming with Rhino 3d which, as a dedicated NURBS program, require extensive use of “Parametric Ranges”. That experience has helped with the learning curve associated with the .NET variant of AutoCAD’s Spline, NURBS, and NURBS Surfaces structures. I do have to concede that the info in ASMI’s post above should be considered more legitimate than mine. I’ve certainly seen enough evidence to trust his recommendations in such matters. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 19, 2009 Author Share Posted January 19, 2009 Thanks for the additional info ASMI, - much appreciated. I trust the info you provide is correct, as, for one, you are a LISP guru, and two, you have a habit of reading help files. I assume that if you use a value greater than that of 2pi, LISP will just correct it by factors of 2pi until it lies in the range 0 Thanks once again guys. 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.