moveGripPointsAt doesnt work with some objects + edit Curve points question

moveGripPointsAt doesnt work with some objects + edit Curve points question

5thSth
Advocate Advocate
373 Views
1 Reply
Message 1 of 2

moveGripPointsAt doesnt work with some objects + edit Curve points question

5thSth
Advocate
Advocate

I've tried to code a script that would reposition all selected grip points according to a function;

It works like a charm on polylines;

but it hits a snag on many other objects;

on lines it does not move points (even though correct input happens)

and on splines it pops an unhandled exception error; 

 

can someone clarify this behaviour for me? Or propose an alternative method?



while on the subject; can someone shed light on how to readjust "Curve point" using the curve point properties? Since I wasnt able to find a "Point3dcollection that would correspond to its points?"

 

                foreach (GripData grip in grips)
                {
                    if (gripCounter % 2 == 0) //skip midpoints
                    {
                        Point3d oldPos = grip.GripPoint;
                        Point3d newPos = adjustPoints3d(oldPos);
                        Vector3d offsetPart = newPos - oldPos;

                        GripDataCollection gripsTemp = new GripDataCollection();
                        gripsTemp.Add(grip);

                        ent.MoveGripPointsAt(gripsTemp, offsetPart, MoveGripPointsFlags.Polar);
                    }
                }

 

0 Likes
374 Views
1 Reply
Reply (1)
Message 2 of 2

5thSth
Advocate
Advocate

addition; Ive realized grip initalization might be important as well.. so here's how I do it.

I've gotten better results when using GetGripPointFlags.CyclableGripsOnly; with Splines... but "Line" still doesnt move.

 

 

     GripDataCollection grips = new GripDataCollection();
                    double curViewUnitSize = 0; int gripSize = 0;
                    Vector3d curViewDir = doc.Editor.GetCurrentView().ViewDirection;

                    GetGripPointsFlags bitFlags = GetGripPointsFlags.GripPointsOnly;

                    var xx = ent.GetGripPoints(grips, curViewUnitSize, gripSize, curViewDir, bitFlags);

 

0 Likes