Transform face

Transform face

miguel_tamaraMXF93
Explorer Explorer
495 Views
3 Replies
Message 1 of 4

Transform face

miguel_tamaraMXF93
Explorer
Explorer

I want to know if I can transform a Face using a Transform instance:

    public Face TransformFace(Face face)
    {
        var feetToMeters = 0.3048;
        Transform scaleTransform = Transform.Identity;
        scaleTransform.set_Basis(0, scaleTransform.BasisX.Multiply(feetToMeters));
        scaleTransform.set_Basis(1, scaleTransform.BasisY.Multiply(feetToMeters));
        scaleTransform.set_Basis(2, scaleTransform.BasisZ.Multiply(feetToMeters));
        // Transform the face
    }

thanks in advance.

0 Likes
496 Views
3 Replies
Replies (3)
Message 2 of 4

Moustafa_K
Collaborator
Collaborator

I think you need to transform the whole solid not the face. and then you can get a transformed face. you can achieve that using the static SolidUtils

var transformedSolid = SolidUtils.CreateTransformed(mySolid, mytransform);

 

then you can get the face from the transformed solid.

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
Message 3 of 4

miguel_tamaraMXF93
Explorer
Explorer

Hello Moustafa,

Thank you for replying! Yes, that works, but let me explain.

I get the face using PickObject. And as you may know, getting the element geometry solids, then finding the solid with the face, transforming it, etc etc, seems more like a workaround, not a straightforward solution.


I wish there was something like a FaceUtils in the API.


In any case, thanks for your help!

0 Likes
Message 4 of 4

Moustafa_K
Collaborator
Collaborator

So glad that this working around deleviers you what you are after. A straight forwarded implementation is a golden wish for every developer. Till then the answer will mostly be in the working around, and how smartly we use the available tools. 🙂

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes