[C# MSEC 10.16/ORD 10.10] Properties of Referenced ConeElement after transform to Master

I have ConeElements in a reference model that I'm trying to use the ConeElements center location and radius after being transformed to the referencing model. Once the transform is complete the range of the element is correct but the center point and radius are incorrect, very small.

Here is the code:

//element retrieved from a list of DgnECInstances
DgnModelRef dgnModelRef = element.DgnModelRef;
DgnAttachment dgnAttachment = dgnModelRef.AsDgnAttachment();
DTransform3d dTransform3D = new DTransform3d();

//pre transform
ConeElement coneElement = (ConeElement)element;
DRange3d coneRange;
coneElement.CalcElementRange(out coneRange);

//transform
dgnAttachment.GetTransformToParent(out dTransform3D, true);
TransformInfo transformInfo = new TransformInfo(dTransform3D);
coneElement.ApplyTransform(transformInfo);
coneElement.CalcElementRange(out coneRange);

Here is the results:

The range transforms correctly, but notice the values for center point, the X value should fall between the range high & low X values (unless I'm missing something.)

Parents
  • Looks like garbage values...

    Are you sure coneElement is still a valid CONE_ELM post transform? For example, applying a non-uniform scale to a CONE_ELM can result in a BSPLINE_SURFACE_ELM since the CONE_ELM structure can't represent some results.

    I almost never transform elements and instead transform the extracted data, it's a lot more robust and efficient this way. There are a number of reasons trying to apply a transform to an element might fail, 2d attached to 3d, element's handler doesn't support the transform (ex. can't scale ABD forms), etc.

    HTH

    -B



Reply
  • Looks like garbage values...

    Are you sure coneElement is still a valid CONE_ELM post transform? For example, applying a non-uniform scale to a CONE_ELM can result in a BSPLINE_SURFACE_ELM since the CONE_ELM structure can't represent some results.

    I almost never transform elements and instead transform the extracted data, it's a lot more robust and efficient this way. There are a number of reasons trying to apply a transform to an element might fail, 2d attached to 3d, element's handler doesn't support the transform (ex. can't scale ABD forms), etc.

    HTH

    -B



Children