LuminescentLoom
Member
I want to export a STEP file then transform it according to the assembly's WorldTransform but it's including a scale factor of 2.54 (inch to cm) which makes the resulting part too big. How should I handle this reliably? Perhaps always remove scaling from the transforms because there's no valid use for them? LocalTransform is the same.
My code for getting the transformation and STEP file is:
Output is:
EDIT: I notice the STEP file it generates has GLOBAL_UNIT_ASSIGNED_CONTEXT set to inches whereas normal parts have it as centimeters. So it looks like the transform would work correctly if you ignored the units in the STEP file and assumed they were always in cm. Unfortunately, the library I'm using to read STEP files doesn't do that.
My code for getting the transformation and STEP file is:
Code:
Dim assemblySession As IADAssemblySession = RootObj.OpenFileEx(assemblyFileName, False)
For Each occurrence As IADOccurrence In assemblySession.RootOccurrence.Occurrences()
For Each value As Double In occurrence.WorldTransform.Array()
Trace.WriteLine(value)
Next
occurrence.DesignSession.ExportAP214("c:/users/ggpc/desktop/b")
Next
assemblySession.Close()
Output is:
Code:
2.54
0
0
0
0
2.54
0
0
0
0
2.54
0
-0.347747921943665
-0.00279688835144043
0
1
EDIT: I notice the STEP file it generates has GLOBAL_UNIT_ASSIGNED_CONTEXT set to inches whereas normal parts have it as centimeters. So it looks like the transform would work correctly if you ignored the units in the STEP file and assumed they were always in cm. Unfortunately, the library I'm using to read STEP files doesn't do that.
Attachments
Last edited: