74 lines
2.8 KiB
Python
74 lines
2.8 KiB
Python
|
|
# NX 2412
|
|||
|
|
# Journal created by antoi on Mon Nov 17 10:26:53 2025 Eastern Standard Time
|
|||
|
|
#
|
|||
|
|
import math
|
|||
|
|
import NXOpen
|
|||
|
|
import NXOpen.CAE
|
|||
|
|
def main(args) :
|
|||
|
|
|
|||
|
|
theSession = NXOpen.Session.GetSession() #type: NXOpen.Session
|
|||
|
|
workSimPart = theSession.Parts.BaseWork
|
|||
|
|
displaySimPart = theSession.Parts.BaseDisplay
|
|||
|
|
# ----------------------------------------------
|
|||
|
|
# Menu: File->Options->Assembly Load Options...
|
|||
|
|
# ----------------------------------------------
|
|||
|
|
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Start")
|
|||
|
|
|
|||
|
|
theSession.SetUndoMarkName(markId1, "Assembly Load Options Dialog")
|
|||
|
|
|
|||
|
|
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Assembly Load Options")
|
|||
|
|
|
|||
|
|
theSession.DeleteUndoMark(markId2, None)
|
|||
|
|
|
|||
|
|
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Assembly Load Options")
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.LoadLatest = False
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.ComponentLoadMethod = NXOpen.LoadOptions.LoadMethod.FromDirectory
|
|||
|
|
|
|||
|
|
searchDirectories1 = [None] * 1
|
|||
|
|
searchDirectories1[0] = "C:\\ProgramData"
|
|||
|
|
searchSubDirs1 = [None] * 1
|
|||
|
|
searchSubDirs1[0] = True
|
|||
|
|
theSession.Parts.LoadOptions.SetSearchDirectories(searchDirectories1, searchSubDirs1)
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.ComponentsToLoad = NXOpen.LoadOptions.LoadComponents.All
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.PartLoadOption = NXOpen.LoadOptions.LoadOption.FullyLoad
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.SetInterpartData(True, NXOpen.LoadOptions.Parent.All)
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.AllowSubstitution = False
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.GenerateMissingPartFamilyMembers = True
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.AbortOnFailure = False
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.OptionUpdateSubsetOnLoad = NXOpen.LoadOptions.UpdateSubsetOnLoad.NotSet
|
|||
|
|
|
|||
|
|
referenceSets1 = [None] * 5
|
|||
|
|
referenceSets1[0] = "As Saved"
|
|||
|
|
referenceSets1[1] = "Use Simplified"
|
|||
|
|
referenceSets1[2] = "Use Model"
|
|||
|
|
referenceSets1[3] = "Entire Part"
|
|||
|
|
referenceSets1[4] = "Empty"
|
|||
|
|
theSession.Parts.LoadOptions.SetDefaultReferenceSets(referenceSets1)
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.ReferenceSetOverride = False
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.SetBookmarkComponentsToLoad(True, False, NXOpen.LoadOptions.BookmarkComponents.LoadVisible)
|
|||
|
|
|
|||
|
|
theSession.Parts.LoadOptions.BookmarkRefsetLoadBehavior = NXOpen.LoadOptions.BookmarkRefsets.ImportData
|
|||
|
|
|
|||
|
|
theSession.DeleteUndoMark(markId3, None)
|
|||
|
|
|
|||
|
|
theSession.SetUndoMarkName(markId1, "Assembly Load Options")
|
|||
|
|
|
|||
|
|
theSession.DeleteUndoMark(markId1, None)
|
|||
|
|
|
|||
|
|
# ----------------------------------------------
|
|||
|
|
# Menu: Tools->Automation->Journal->Stop Recording
|
|||
|
|
# ----------------------------------------------
|
|||
|
|
|
|||
|
|
if __name__ == '__main__':
|
|||
|
|
main(sys.argv[1:])
|