CreatePCurve returns null

Discussion in 'SolidWorks' started by vasa, Apr 21, 2004.

  1. vasa

    vasa Guest

    Hello All!

    now i am tring to create pcurve (parametric curve or curve
    projection onto surface) from 3D-curve (e.g. from LINE).

    The following is pascal (Delphi) variant of code:

    var v_props, v_knots, v_ctrlPtCoords: variant;
    ...
    val := iCrv.ConvertLineToBcurve (v_start, v_end);
    v_props := VarArrayCreate([0,1], varDouble);
    v_props[0] := val[0]; //DimensionControlPoints and Order
    //in this case: DimensionControlPoints=3 , Order=2
    v_props[1] := val[1]; //NumCtrlPoints and Periodicity
    //in this case: NumCtrlPoints=2 , Periodicity=0

    v_knots := VarArrayCreate([0, NumCtrlPoints+order-1], varDouble);
    v_ctrlPtCoords := VarArrayCreate([0,
    NumCtrlPoints*DimensionControlPoints-1],
    varDouble);

    for i:=0 to (NumCtrlPoints + order) -1 do
    v_knots := val[i+2];
    sz := i+2;
    for i:=0 to (NumCtrlPoints * DimensionControlPoints) -1 do
    v_ctrlPtCoords := val[i+sz];

    pCurve := fModeler.CreatePCurve(fSurface,v_props,v_knots,v_ctrlPtCoords)
    as iCurve;

    and here : (pCurve == nil) ?!?!
    why? could You help me please?

    Thanks,
    Vasilii Sorokin
     
    vasa, Apr 21, 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.