Hi, all:
Just described as the title, I wanna covert the coordinate’s original of the model to the model’s bottom center with no changing the direction of the axis. Are there any C++ APIs could to do this? Or a code segment is better.
Hey, tt. Thanks for your instant reply, I have completed the first four steps. However, the last step with function SUEntitiesRef : SUEntitiesTransform, the in parameters as following:
[in]
entities
The entities object.
[in]
len
The number of entities in the array.
[in]
elements
The elements to be transformed.
[in]
trans
The transform to be applied.
I have got the root entities from the model, is there any way to get all entity from entities for the second and third parameters of SUEntitiesTransform?
You can use SUEntitiesEntityListFill with the type SURefType_Entity to get an SUEntityListRef that you can use to iterate the entire collection. While iterating you use SUEntityListIteratorGetEntity to get and SUEntityRef object which you can add to the array you pass to SUEntitiesTransform.
Thank you tt and Dan. I have finished the whole process and it works fine. The last question is about code optimization, I use the iterator of SUEntityListRef, but didn’t find how to judge the end of the iterator with the single line of code in loop for. And my workround way is as following: