creating bezier (or nurbs) curves using COM interface

Discussion in 'AutoCAD' started by Andrew Wolven, Apr 14, 2004.

  1. I'm not actually using VB or VBA, but I am using the COM interface to
    Autocad, so maybe someone in using VB might know something about this...

    Somewhere I read that an Autocad Spline is represented internally as a NURBS
    curve. I have read that a nurbs curve can be represented by a set of
    control points, knot-vector, weights and degree. I have also read that a
    bezier curve can be represented exactly as a type of nurbs curve (using a
    specific knot vector, etc.)

    Here is my problem: The COM interface to Autocad seems to be more geared to
    scripting user input as opposed to general programming. I think that
    because of this the method AddSpline takes the arguments PointsArray,
    StartTangent, and EndTangent. These seem to be the types of inputs that
    someone actually drawing a curve would give.

    What I want to do is to take a bezier (or nurbs) data structure and plop it
    into Autocad. AddSpline does not seem to be all that useful for this
    because the PointsArray seems to be actual points on the curve and not
    really nurbs control points, if I am interpreting this correctly.

    The Spline interface seems to appear to be a little more promising (once you
    have a curve in Autocad.) It has ControlPoints and Weights and Degree, so
    perhaps once I put a curve in to Autocad I can modify it to be the bezier
    that I want. But what about the knot vector? And, do the ControlPoints,
    Weights, and Degree mean the same thing on this interface object as they
    would for a nurbs in another program?

    Does anyone have any experience creating nurbs with the vb/vba/com interface
    in a way that uses knot-vectors etc.? I am hoping so before I try to
    reverse engineer an IAcadSpline into a nurbs. I know from reading posts on
    these newsgroups that you can do such things with autolisp and entmake, so
    there has to be some way to do it with COM.

    Any insight into this problem would be greatly appreciated.

    Oh yeah, I'm currently using R14 but plan to upgrade soon.

    Thanks,
    Andrew W.
     
    Andrew Wolven, Apr 14, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.