# Designcenter 2512
# Journal created by antoi on Thu Dec 18 14:06:36 2025 Eastern Standard Time
#
import math
import NXOpen
import NXOpen.Gateway
def main(args) : 

    theSession  = NXOpen.Session.GetSession() #type: NXOpen.Session
    workPart = theSession.Parts.Work
    displayPart = theSession.Parts.Display
    # ----------------------------------------------
    #   Menu: Edit->Show and Hide->Show and Hide...
    # ----------------------------------------------
    markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
    
    theSession.SetUndoMarkName(markId1, "Show and Hide Dialog")
    
    markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Hide Datums")
    
    numberHidden1 = theSession.DisplayManager.HideByType("SHOW_HIDE_TYPE_DATUMS", NXOpen.DisplayManager.ShowHideScope.AnyInAssembly)
    
    nErrs1 = theSession.UpdateManager.DoUpdate(markId2)
    
    workPart.ModelingViews.WorkView.FitAfterShowOrHide(NXOpen.View.ShowOrHideType.HideOnly)
    
    markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Hide Curves")
    
    numberHidden2 = theSession.DisplayManager.HideByType("SHOW_HIDE_TYPE_CURVES", NXOpen.DisplayManager.ShowHideScope.AnyInAssembly)
    
    nErrs2 = theSession.UpdateManager.DoUpdate(markId3)
    
    exists1 = theSession.DoesUndoMarkExist(markId3, "Hide Curves")
    
    theSession.DeleteUndoMark(markId3, "Hide Curves")
    
    workPart.ModelingViews.WorkView.FitAfterShowOrHide(NXOpen.View.ShowOrHideType.HideOnly)
    
    markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Hide Sketches")
    
    numberHidden3 = theSession.DisplayManager.HideByType("SHOW_HIDE_TYPE_SKETCHES", NXOpen.DisplayManager.ShowHideScope.AnyInAssembly)
    
    nErrs3 = theSession.UpdateManager.DoUpdate(markId4)
    
    workPart.ModelingViews.WorkView.FitAfterShowOrHide(NXOpen.View.ShowOrHideType.HideOnly)
    
    theSession.SetUndoMarkName(markId1, "Show and Hide")
    
    theSession.DeleteUndoMark(markId1, None)
    
    matrix1 = NXOpen.Matrix3x3()
    
    matrix1.Xx = 0.0
    matrix1.Xy = -1.0
    matrix1.Xz = 0.0
    matrix1.Yx = -1.0
    matrix1.Yy = -0.0
    matrix1.Yz = -0.0
    matrix1.Zx = 0.0
    matrix1.Zy = 0.0
    matrix1.Zz = -1.0
    workPart.ModelingViews.WorkView.Orient(matrix1)
    
    scaleAboutPoint1 = NXOpen.Point3d(-759.81281858578541, -319.30527689743337, 0.0)
    viewCenter1 = NXOpen.Point3d(759.81281858579484, 319.30527689744417, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(0.80000000000000004, scaleAboutPoint1, viewCenter1)
    
    scaleAboutPoint2 = NXOpen.Point3d(-949.76602323223278, -399.13159612179305, 0.0)
    viewCenter2 = NXOpen.Point3d(949.76602323224245, 399.13159612180385, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(0.80000000000000004, scaleAboutPoint2, viewCenter2)
    
    scaleAboutPoint3 = NXOpen.Point3d(-1394.8708922057567, -214.19365760462478, 0.0)
    viewCenter3 = NXOpen.Point3d(1394.870892205766, 214.19365760463569, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint3, viewCenter3)
    
    scaleAboutPoint4 = NXOpen.Point3d(-1115.8967137646043, -171.35492608369873, 0.0)
    viewCenter4 = NXOpen.Point3d(1115.8967137646139, 171.35492608370959, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(0.80000000000000004, scaleAboutPoint4, viewCenter4)
    
    # ----------------------------------------------
    #   Menu: File->Export->Image...
    # ----------------------------------------------
    markId5 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
    
    imageExportBuilder1 = workPart.Views.CreateImageExportBuilder()
    
    imageExportBuilder1.RegionMode = True
    
    regiontopleftpoint1 = [None] * 2 
    regiontopleftpoint1[0] = 95
    regiontopleftpoint1[1] = 83
    imageExportBuilder1.SetRegionTopLeftPoint(regiontopleftpoint1)
    
    imageExportBuilder1.RegionWidth = 1157
    
    imageExportBuilder1.RegionHeight = 1056
    
    imageExportBuilder1.DeviceWidth = 2388
    
    imageExportBuilder1.DeviceHeight = 1172
    
    imageExportBuilder1.FileFormat = NXOpen.Gateway.ImageExportBuilder.FileFormats.Png
    
    imageExportBuilder1.FileName = "C:\\Users\\antoi\\Atomizer\\studies\\M1_Mirror\\m1_mirror_cost_reduction_V4\\1_setup\\M1_Blank_Top.png"
    
    imageExportBuilder1.BackgroundOption = NXOpen.Gateway.ImageExportBuilder.BackgroundOptions.Original
    
    imageExportBuilder1.EnhanceEdges = False
    
    nXObject1 = imageExportBuilder1.Commit()
    
    theSession.DeleteUndoMark(markId5, "Export Image")
    
    imageExportBuilder1.Destroy()
    
    markId6 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
    
    imageExportBuilder2 = workPart.Views.CreateImageExportBuilder()
    
    imageExportBuilder2.Destroy()
    
    theSession.UndoToMark(markId6, None)
    
    theSession.DeleteUndoMark(markId6, None)
    
    rotMatrix1 = NXOpen.Matrix3x3()
    
    rotMatrix1.Xx = -0.34262722569067999
    rotMatrix1.Xy = -0.93944302509010613
    rotMatrix1.Xz = 0.0073066288434778118
    rotMatrix1.Yx = -0.67329035687890959
    rotMatrix1.Yy = 0.24011894541756998
    rotMatrix1.Yz = -0.69930178563008338
    rotMatrix1.Zx = 0.65519972493078527
    rotMatrix1.Zy = -0.2445193134725811
    rotMatrix1.Zz = -0.71478921773451431
    translation1 = NXOpen.Point3d(-691.94814615291523, -16.771832954225655, -903.92900031772103)
    workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix1, translation1, 0.20258147300869808)
    
    scaleAboutPoint5 = NXOpen.Point3d(-1091.8652302284754, -297.78142642594378, 0.0)
    viewCenter5 = NXOpen.Point3d(1091.8652302284847, 297.78142642595469, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint5, viewCenter5)
    
    scaleAboutPoint6 = NXOpen.Point3d(-873.49218418277917, -238.22514114075392, 0.0)
    viewCenter6 = NXOpen.Point3d(873.49218418278895, 238.2251411407648, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint6, viewCenter6)
    
    scaleAboutPoint7 = NXOpen.Point3d(-519.08004438038643, -302.5877231331695, 0.0)
    viewCenter7 = NXOpen.Point3d(519.08004438039586, 302.58772313318048, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(0.80000000000000004, scaleAboutPoint7, viewCenter7)
    
    scaleAboutPoint8 = NXOpen.Point3d(-648.85005547548417, -378.23465391646323, 0.0)
    viewCenter8 = NXOpen.Point3d(648.85005547549372, 378.23465391647414, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(0.80000000000000004, scaleAboutPoint8, viewCenter8)
    
    scaleAboutPoint9 = NXOpen.Point3d(-726.16874163520447, -271.6602486692816, 0.0)
    viewCenter9 = NXOpen.Point3d(726.16874163521379, 271.66024866929223, 0.0)
    workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint9, viewCenter9)
    
    rotMatrix2 = NXOpen.Matrix3x3()
    
    rotMatrix2.Xx = -0.35281096074613638
    rotMatrix2.Xy = -0.93549939803135751
    rotMatrix2.Xz = 0.019112882052533756
    rotMatrix2.Yx = -0.67083068516183819
    rotMatrix2.Yy = 0.23864906945399289
    rotMatrix2.Yz = -0.70216295366107118
    rotMatrix2.Zx = 0.65231174895343103
    rotMatrix2.Zy = -0.26055229404422597
    rotMatrix2.Zz = -0.71175970962509794
    translation2 = NXOpen.Point3d(-445.60899304577225, -25.448049758528374, -903.92478002019129)
    workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix2, translation2, 0.25322684126087264)
    
    rotMatrix3 = NXOpen.Matrix3x3()
    
    rotMatrix3.Xx = -0.32736574141345925
    rotMatrix3.Xy = -0.94489752125198745
    rotMatrix3.Xz = -0.00058794613984273266
    rotMatrix3.Yx = -0.71924452681462514
    rotMatrix3.Yy = 0.24959027079525001
    rotMatrix3.Yz = -0.64837643955618585
    rotMatrix3.Zx = 0.61279603621108569
    rotMatrix3.Zy = -0.21183335680718612
    rotMatrix3.Zz = -0.76131967460967154
    translation3 = NXOpen.Point3d(-445.6364375527848, -25.373121722553414, -903.99382020435428)
    workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix3, translation3, 0.25322684126087264)
    
    # ----------------------------------------------
    #   Menu: File->Export->Image...
    # ----------------------------------------------
    markId7 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
    
    imageExportBuilder3 = workPart.Views.CreateImageExportBuilder()
    
    imageExportBuilder3.RegionMode = True
    
    regiontopleftpoint2 = [None] * 2 
    regiontopleftpoint2[0] = 129
    regiontopleftpoint2[1] = 96
    imageExportBuilder3.SetRegionTopLeftPoint(regiontopleftpoint2)
    
    imageExportBuilder3.RegionWidth = 1343
    
    imageExportBuilder3.RegionHeight = 1045
    
    imageExportBuilder3.DeviceWidth = 2388
    
    imageExportBuilder3.DeviceHeight = 1172
    
    imageExportBuilder3.FileFormat = NXOpen.Gateway.ImageExportBuilder.FileFormats.Png
    
    imageExportBuilder3.FileName = "C:\\Users\\antoi\\Atomizer\\studies\\M1_Mirror\\m1_mirror_cost_reduction_V4\\1_setup\\M1_Blank_iso.png"
    
    imageExportBuilder3.BackgroundOption = NXOpen.Gateway.ImageExportBuilder.BackgroundOptions.Original
    
    imageExportBuilder3.EnhanceEdges = False
    
    nXObject2 = imageExportBuilder3.Commit()
    
    theSession.DeleteUndoMark(markId7, "Export Image")
    
    imageExportBuilder3.Destroy()
    
    # ----------------------------------------------
    #   Menu: Tools->Automation->Journal->Stop Recording
    # ----------------------------------------------
    
if __name__ == '__main__':
    main(sys.argv[1:])