The Transform of BoundingBoxXYZ is useless.

The Transform of BoundingBoxXYZ is useless.

Anonymous
Not applicable
602 Views
3 Replies
Message 1 of 4

The Transform of BoundingBoxXYZ is useless.

Anonymous
Not applicable

I found that I could not control the 'Transform' properties to modify the BoundingBox.

 

```csharp

var box = new BoundingBoxXYZ();
var builder = new StringBuilder();

builder.AppendLine("Before Rotation Matrix:");
builder.AppendLine($"The Min of Box: {box.Min}");
builder.AppendLine($"The Max of Box: {box.Max}");
builder.AppendLine($"The Transform of Box: {box.Transform}");

// It doesn't seem to work.
box.Transform = Transform.CreateTranslation(XYZ.BasisZ * 200);

builder.AppendLine("After Rotation Matrix:");
builder.AppendLine($"The Min of Box: {box.Min}");
builder.AppendLine($"The Max of Box: {box.Max}");
builder.AppendLine($"The Transform of Box: {box.Transform}");

```

0 Likes
Accepted solutions (1)
603 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni
Accepted solution

Oh dear. You sound a bit negative here. I guess it depends on how it is used. I think that certain aspects of setting the view crop box, scope box and section box make use of this functionality. You can probably set the bounding box transform, just as you have done, and then make use of it in your own code, which you are apparently not yet doing. I guess Revit does, in certain situations. For instance, take a look at the documentation and sample code of the Transform property:

  

https://www.revitapidocs.com/2017/297887ab-69bb-548e-cfb6-a3a23f410604.htm

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 4

Anonymous
Not applicable
Yes, I should have thought of that, didn't look in the right place.
Message 4 of 4

Anonymous
Not applicable

@jeremy_tammik 

Thank you very much!