Message 1 of 1
Occurence lose his origin-orientation after move his XY-Origin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
occ1 (and its origin) should be moved in X and Y to the origin of occ2.
That works fine, but why does occ1 (its origin) then lose the rotation it had in the XY plane?
Best regards
Maurizio
if occ1 is not None and occ2 is not None:
occ2.component.name = occ1.component.name
des = adsk.fusion.Design.cast(app.activeProduct)
isParametric = des.designType == adsk.fusion.DesignTypes.ParametricDesignType
if isParametric == True:
result = ui.messageBox(
moveOcc1ToOcc2Str,
deleteConstructionHistoryStr,
adsk.core.MessageBoxButtonTypes.OKCancelButtonType,
adsk.core.MessageBoxIconTypes.QuestionIconType
)
if result == adsk.core.DialogResults.DialogOK:
des.designType = adsk.fusion.DesignTypes.DirectDesignType
else:
ui.messageBox(moveOcc1ToOcc2ErrorStr)
isParametric = des.designType == adsk.fusion.DesignTypes.ParametricDesignType
if isParametric == False:
zOld = occ1.transform.translation.z
pt2 = occ2.transform.translation
xTarget = pt2.x
yTarget = pt2.y
newTrans = adsk.core.Matrix3D.create()
newTrans.translation = adsk.core.Vector3D.create(xTarget, yTarget, zOld)
occ1.transform = newTrans