Prod.: Engine, ver.: 6, ID: 60001656, HowTo : Changing the extrusion vector of a vdInsert then the vdAttrib objects do not change

HowTo : Changing the extrusion vector of a vdInsert then the vdAttrib objects do not change

Article60001656
TypeHowTo
ProductEngine
Version6
Date Added3/22/2012
Submitted byMark Seguin
Keywords

Subject

Changing the extrusion vector of a vdInsert then the vdAttrib objects do not change

Summary

If i changing the extrusion vector of a vdInsert then the vdAttrib objects do not change. How can I do this and also change the vdAttributes ?

Solution

This is an expected behavior. You need to change the “direction” of the vdInsert as the vdInsert’s extrusion vector property doesn't change the extrusion vector of the attributes that are referenced by the insert. Instead use the Rotate3D method of CommandAction or a code like :
    VectorDraw.Geometry.gPoint pt = new VectorDraw.Geometry.gPoint(ins.InsertionPoint);
    VectorDraw.Geometry.Matrix mat = new VectorDraw.Geometry.Matrix();
    mat.TranslateMatrix(-pt.x, -pt.y, -pt.z);
    mat.ApplyECS2WCS(new VectorDraw.Geometry.Vector(1, 0, 0));
    mat.TranslateMatrix(pt.x, pt.y, pt.z);
    ins.Transformby(mat);
    ins.Update();
    ins.Invalidate();