Hi @danielWNW3M -San.
We created and tested simple data.
The "ooc1" was moved X10mmY20mmZ30mm,
ooc2" is the data with X10mmY20mmZ30mm shifted further.
The following script was created and executed
The "transform" property is obsolete, but is still available in the current version 2.0.18950.
# Fusion360API Python script
import traceback
import adsk.core as core
import adsk.fusion as fusion
def run(context):
ui: core.UserInterface = None
try:
app: core.Application = core.Application.get()
ui = app.userInterface
des: fusion.Design = app.activeProduct
root: fusion.Component = des.rootComponent
occ1: fusion.Occurrence = root.occurrences[0]
occ2: fusion.Occurrence = occ1.component.occurrences[0]
dump(f"Fusion360 Ver{app.version}")
dump_matrix(occ1.transform2,"occ1.transform2")
dump_matrix(occ1.transform,"occ1.transform")
dump_matrix(occ2.transform2,"occ2.transform2")
dump_matrix(occ2.transform,"occ2.transform")
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def dump_matrix(
mat: core.Matrix3D,
msg: str = ""
) -> None:
origin, vecX, vecY, vecZ = mat.getAsCoordinateSystem()
info = "".join(
[
f"{msg} : ",
f"origin{origin.asArray()}_",
f"vecX{vecX.asArray()}_",
f"vecY{vecY.asArray()}_",
f"vecZ{vecZ.asArray()}",
]
)
dump(info)
def dump(
msg: str,
) -> None:
print(msg)
core.Application.get().log(msg)
Here is the result of the execution.
Fusion360 Ver2.0.18950
occ1.transform2 : origin(1.0, 2.0, 3.0)_vecX(1.0, 0.0, 0.0)_vecY(0.0, 1.0, 0.0)_vecZ(0.0, 0.0, 1.0)
occ1.transform : origin(1.0, 2.0, 3.0)_vecX(1.0, 0.0, 0.0)_vecY(0.0, 1.0, 0.0)_vecZ(0.0, 0.0, 1.0)
occ2.transform2 : origin(0.0, 0.0, 0.0)_vecX(1.0, 0.0, 0.0)_vecY(0.0, 1.0, 0.0)_vecZ(0.0, 0.0, 1.0)
occ2.transform : origin(1.0, 2.0, 3.0)_vecX(1.0, 0.0, 0.0)_vecY(0.0, 1.0, 0.0)_vecZ(0.0, 0.0, 1.0)
Here is the result I expected from occ2.transform2.
occ2.transform2 : origin(2.0, 4.0, 6.0)_vecX(1.0, 0.0, 0.0)_vecY(0.0, 1.0, 0.0)_vecZ(0.0, 0.0, 1.0)
It is probably broken now.
I think what you are looking for is the "transform" property.
I don't think "transform" property should be obsolete because "transform" property and "transform2" property have different meanings.