0

I'm experimenting with transforms. And trying to perform and store multiple transforms, but unable to probably due to the static property of transforms. Something like this:

Wall wall = doc.GetElement(id) as Wall;
BoundingBoxXYZ wallBoundingBox = wall.get_BoundingBox(doc.ActiveView);

//Original
Transform originalTransform = wallBoundingBox.Transform;

//Translated
Transform translatedTransform = originalTransform.CreateTranslation(wallBoundingBox.Min);

Error msg: "Member 'Transform.CreateTranslation(XYZ)' cannot be accessed with an instance reference, qualify it with a type name instead."

Are there any workarounds for this?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Han
  • 5
  • 3
  • according to http://help.autodesk.com/view/RVT/2018/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Revit_Geometric_Elements_Geometry_Geometry_Helper_Classes_html] you need to use Operator* - Multiplies two specified transforms. – AakashM May 01 '19 at 09:01
  • Interesting approach! I tried to test ways to get a transform using XYZs, but cant seem to find a way, any insights? – Han May 01 '19 at 10:01
  • Sorry, not a system I've ever used, I was just reading API references... – AakashM May 01 '19 at 10:25

1 Answers1

0

CreateTranslation is a static member of the Transform class.

Use it like this:

Transform translatedTransform 
  = Transform.CreateTranslation(
    wallBoundingBox.Min);
Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17