-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbreak.py
41 lines (30 loc) · 1.39 KB
/
break.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# NX 1969
# Journal created by Wesoly on Thu Oct 7 10:21:18 2021 W. Europe Daylight Time
#
import math
import NXOpen
import NXOpen.Annotations
import NXOpen.Drafting
import NXOpen.Drawings
import NXOpen.MenuBar
def main() :
theSession = NXOpen.Session.GetSession()
workPart = theSession.Parts.Work
displayPart = theSession.Parts.Display
theUI = NXOpen.UI.GetUI()
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "break")
objects1 = [NXOpen.DisplayableObject.Null] * 1
verticalOrdinateDimension1 = theUI.SelectionManager.GetSelectedObject(0)
#for object in verticalOrdinateDimension1:
objects1[0] = verticalOrdinateDimension1
editSettingsBuilder1 = workPart.SettingsManager.CreateAnnotationEditSettingsBuilder(objects1)
dimensionlinearunits1 = editSettingsBuilder1.AnnotationStyle.UnitsStyle.DimensionLinearUnits
editsettingsbuilders1 = [NXOpen.Drafting.BaseEditSettingsBuilder.Null] * 1
editsettingsbuilders1[0] = editSettingsBuilder1
workPart.SettingsManager.ProcessForMultipleObjectsSettings(editsettingsbuilders1)
editSettingsBuilder1.AnnotationStyle.BreakSettings.CreateBreaks = True
editSettingsBuilder1.AnnotationStyle.BreakSettings.BreakSize = 2.5
nXObject1 = editSettingsBuilder1.Commit()
editSettingsBuilder1.Destroy()
if __name__ == '__main__':
main()