AECOsim 10.0.0.118
I have a C# Addin tool that will both move and rotate selected elements as a single operation. It works well with a wide variety of element types (lines, shapes, cells etc.) but is throwing an error on ReferenceAttachment types.
Error is:An exception of type 'System.Runtime.InteropServices.COMException' occured...Additional information: Attempting to perform a graphical operation on a non-graphical element
Does element.transform support ReferenceAttachment types?
If not can someone please point me in the right direction on how I might handle moving the referenceattachment element?
The method I am using is shown below:
private void ScaleMoveAndRotate(Element ele, Matrix3d mtrxRotation, Point3d pntFixed, Point3d pntDistance, Point3d pntScaleFactors) { Matrix3d mtrxScale; Matrix3d mtrxCombined;
Transform3d trns; Transform3d trnsMove;
//Create a scaling matrix mtrxScale = app.Matrix3dFromScaleFactors(pntScaleFactors.X, pntScaleFactors.Y, pntScaleFactors.Z);
//Multiply the matrices to create a matrix that scales and rotates mtrxCombined = app.Matrix3dFromMatrix3dTimesMatrix3d(mtrxRotation, mtrxScale);
//Create a transform to rotate and scale about a fixed point trns = app.Transform3dFromMatrix3dAndFixedPoint3d(mtrxCombined, pntFixed);
//Create a transform for moving the element trnsMove = app.Transform3dFromXYZ(pntDistance.X, pntDistance.Y, pntDistance.Z);
trns = app.Transform3dFromTransform3dTimesTransform3d(trnsMove, trns); ele.Transform(trns); }