go on STEP File's entities UpdateOrientedBoundingBox
In solidworks,They build an assembly from many parts.
Each part has own coordination system.
when they built up all of parts to an assembly,and each part may be rotated.
then,not all entites are Up-z, maybe some entities are Up-y ,some entities are Up-x.
when i export to a step(AP214),these attributes are reserved.
I load the step to my viewport,i want make all entities are Up-z.
then,i call translate(0,0,1000)
the entites will move Up , not Left in my view.
There is no such thing as UpZ or UpX in Solidworks
. Everything is UpY.
When you make an assembly all parts are either positioned manually or using mates (99% of the time). This process will nearly all the time rotate and translate the part.
When you export to Step
or Iges
(2 main export format that Eyeshot can use) All geometry that are generated in those files do not contain the original matrix. If you look at the vertex of a part you will see the vertex of the Mesh
are positioned relative to the world and not to an internal matrix.
That being said if you loop through all entities in the viewport and translate each of them in Z they will ALL move in the same direction.
In order to keep the final matrix the principle is quite easy as i have done it already but you need to know your way around the Solidworks API
. You need to create a Solidworks Addin
and add a button or menu to Solidworks
. Then once you code something to export each parts individually into step which will keep their original rotation before being modified into the assembly. If you have 10 parts you should end up with 10 Step
files unless the same part is used many times in the assembly then you will have less.
Finally you need to use the assembly to get the matrix of each part in the assembly and make some sort of file with an association of PartName
to Matrix
so you should have every single parts.
When you get to Eyeshot
all you have to do is load the proper step and apply the matrix you saved in the file. Then if you want to move everything relative to their own Z axis you simple create a Z vector with the wanted displacement i.e. : (0, 0, 1000) and transform that vector by one of the part matrix and then translate that same part by the transformed vector. And finally you repeat the same process for each parts.
Adding this part with an easier to read step by step for the process of getting the real matrix :
Solidworks
Step
as part1.stepStep
files and transform the block by the matrix in the text file.