-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode_holder
349 lines (250 loc) · 11.1 KB
/
code_holder
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
print("Available FreeCAD.ActiveDocument")
print(dir(FreeCAD.ActiveDocument))
print("Jobs")
newJob = FreeCAD.ActiveDocument.getObject("Job")
print(type(newJob))
print(newJob.Label)
print("Operations")
p = FreeCAD.ActiveDocument.getObject("Operations")
print(type(p))
print("dressups")
p = FreeCAD.ActiveDocument.getObject("DressupTag")
print(type(p))
if obj.TypeId == 'Path::FeaturePython':
print("dir(obj)",dir(obj))
parent=obj.getParent()
print("obj proxy: ", obj.Proxy)
print("dir(obj.Proxy)",dir(obj.Proxy))
if "PROFILE" in obj.Name.upper() or "POCKET" in obj.Name.upper() or \
"DRILL" in obj.Name.upper() or "FACE" in obj.Name.upper() or \
"CONTOUR" in obj.Name.upper() or "THREAD" in obj.Name.upper() or \
"ENGRAVE" in obj.Name.upper() or "DEBURR" in obj.Name.upper():
opArray.append(obj)
print("op parent: ", parent)
if "TC__" in obj.Name.upper():
print("Proxy type",type(obj.Proxy))
#if obj.proxy.getType() == "Path.Tool.Controller.ToolController":
# print("DING!")
toolArray.append(obj)
print("tool parent: ", parent)
if hasattr(parent, 'Label'):
print("\tparent label: ", parent.Label)
if "JOB" in obj.Name.upper():
jobArray.append(obj)
print("job parent: ", parent)
print("\n\n")
print("opArray size: ", len(opArray))
for op in opArray:
print("op.Name: ", op.Name, " | op.Label: ", op.Label, " | op.TypeId: ", op.TypeId)
print(dir(op))
if hasattr(op, 'Label'):
print("\tLabel: ", op.Label)
if hasattr(op, 'FullName'):
print("\tFullName: ", op.FullName)
if hasattr(op, 'Active'):
print("\tActive: ", op.Active)
if hasattr(op, 'Direction'):
print("\tDirection: ", op.Direction)
else:
print("\tDirection: None")
if hasattr(op, 'CoolantMode'):
print("\tCoolantMode: ", op.CoolantMode)
if hasattr(op, 'CycleTime'):
print("\tCycleTime: ", op.CycleTime)
if hasattr(op, 'Description'):
print("\tDescription: ", op.Description)
if hasattr(op, 'Document'):
print("\tDocument: ", op.Document)
#if hasattr(op, 'ExpressionEngine'):
# print("\tExpressionEngine: ", op.ExpressionEngine)
if hasattr(op, 'GeometryTolerance'):
print("\tGeometryTolerance: ", op.GeometryTolerance)
if hasattr(op, 'Group'):
print("\tGroup: ", op.Group)
if hasattr(op, 'ToolController') :
print("\tToolController: ", op.ToolController)
print("\tdir ToolController: ", dir(op.ToolController))
print("\tToolController.ToolNumber: ", op.ToolController.ToolNumber)
print("\tToolController.Tool: ", op.ToolController.Tool)
if hasattr(op, 'Path'):
print("\tPath: ", op.Path)
#print("dir:", dir(op.Path))
for cmd in op.Path.Commands:
print("\t\tCommands:", cmd)
print("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n")
#print("\tPath cnt: ", op.Path.count)
#for aMove in op.Path:
# print("\t\tPseudo Gcode: ", aMove)
if hasattr(op, 'Content'):
print("\tContent: ", op.Content)
print("\n\n")
print("toolArray size: ",len(toolArray))
for tool in toolArray:
print("tool.Name: ", tool.Name, " | tool.Label: ", tool.Label, " | tool.TypeId: ", tool.TypeId)
#print(dir(tool))
print("tool:",tool.ToolNumber)
# " | ", tool.Name, " | ", tool.Label, " | ", tool.TypeId))
print("\n\n")
print("jobArray size: ",len(jobArray))
for job in jobArray:
print("job.Name: ", job.Name, " | job.Label: ", job.Label, " | job.TypeId: ", job.TypeId)
print("\n\n")
jobObjs=[]
# The attribute Fixtures is unique to Jobs
for obj in docObjs:
if hasattr(obj, 'Fixtures'):
if obj.TypeId == 'Path::FeaturePython':
# if "Job" in obj.Label:
jobObjs.append(obj)
print("jobObjs: ", jobObjs)
for aJob in jobObjs:
print("aJob.Label: ", aJob.Label)
print(type(aJob))
print(dir(aJob))
print("\n\n")
print("--------------")
print("\n\n")
# print("Content: ", aJob.Content) gives a list of printable objects
print("Attributes of a job:")
print(" Label: ", aJob.Label)
print(" Description: ", aJob.Description)
print(" Document: ", aJob.Document)
print(" Output filename:",aJob.PostProcessorOutputFile)
print(" State: ", aJob.State)
print(" PostProcessor: ", aJob.PostProcessor)
print(" PostProcessor Args: ", aJob.PostProcessorArgs)
print(" CycleTime: ", aJob.CycleTime)
print(" Fixtures: ", aJob.Fixtures)
#print(" Job Type: ", aJob.)
print("\n")
print(" SetUp Sheet:")
#print(" : ", aJob.SetupSheet.)
print(" FullName: ", aJob.SetupSheet.FullName)
print(" ClearanceHeightExpression: ", aJob.SetupSheet.ClearanceHeightExpression)
print(" ClearanceHeightOffset: ", aJob.SetupSheet.ClearanceHeightOffset)
# printing contents lets you know what is in the entire list
#print(" Content: ", aJob.SetupSheet.Content)
print(" CoolantMode: ", aJob.SetupSheet.CoolantMode)
print(" CoolantModes: ", aJob.SetupSheet.CoolantModes)
print(" ExpressionEngine: ", aJob.SetupSheet.ExpressionEngine)
#print(" Document: ", aJob.SetupSheet.Document)
print(" FinalDepthExpression: ", aJob.SetupSheet.FinalDepthExpression)
print("\n")
print(" Tools used:")
for tc in aJob.Tools.Group:
print(" tc: ", tc.ToolNumber, " name: ", tc.FullName)
print("\n")
print(" Operations:")
print(" InList: ")
#print(" Content: ", aJob.Operations.InList.Content)
#print(" Content: ", aJob.Operations.InList.Group)
#lclList=aJob.Operations.InList
print(" List size: ", aJob.Operations.InList.__len__())
for opListItem in aJob.Operations.InList:
print(" opListItem: ", opListItem.Name, " | ", opListItem.Label, " | ", opListItem.TypeId, " | ", opListItem.FullName)
print(dir(opListItem))
print(dir(opListItem.Operations))
print("name:", opListItem.Operations.Name)
print("\n")
print(" OutList: ")
print(" List size: ", aJob.Operations.OutList.__len__())
for opListItem in aJob.Operations.OutList:
print(" opListItem: ", opListItem.Name, " | ", opListItem.Label, " | ", opListItem.TypeId, " | ", opListItem.FullName)
print("-----------------")
#exit()
type(aJob.Content)
print("Content: ", aJob.Content)
print("============================")
print("CycleTime: ", aJob.CycleTime)
print("Description: ", aJob.Description)
print("Document: ", aJob.Document)
print("ExpressionEngine: ", aJob.ExpressionEngine)
print("FullName: ", aJob.FullName)
print("GeometryTolerance: ", aJob.GeometryTolerance)
print("Group: ", aJob.Group)
print("ID: ", aJob.ID)
print("InList: ", aJob.InList)
print("InListRecursive: ", aJob.InListRecursive)
print("Label2: ", aJob.Label2)
print("LastPostProcessDate: ", aJob.LastPostProcessDate)
print("LastPostProcessOutput: ", aJob.LastPostProcessOutput)
print("MemSize: ", aJob.MemSize)
print("Model: ", aJob.Model)
print("MustExecute: ", aJob.MustExecute)
print("Name: ", aJob.Name)
print("NoTouch: ", aJob.NoTouch)
print("OldLabel: ", aJob.OldLabel)
print("Operations: ", aJob.Operations)
print(type(aJob.Operations))
print("dir operation:",dir(aJob.Operations))
print("Operations as a class: ", aJob.Operations.__class__)
print("Operations as a name: ", aJob.Operations.__class__.__name__)
print("Operations as a bases: ", aJob.Operations.__class__.__bases__)
print("Operations as a mro: ", aJob.Operations.__class__.__mro__)
print("Operations as a dict ", aJob.Operations.__class__.__dict__)
print("Operations as a module: ", aJob.Operations.__class__.__module__)
# Assuming aJob.Operations is the object you're interested in
methods = [method for method in dir(aJob.Operations) if callable(getattr(aJob.Operations, method)) and not method.startswith('__')]
print("Available methods for aJob.Operations:")
for method in methods:
print(" ",method)
# List attributes of aJob.Operations, excluding methods and magic methods
attributes = [attr for attr in dir(aJob.Operations) if not callable(getattr(aJob.Operations, attr)) and not attr.startswith('__')]
print("Available attributes for aJob.Operations:")
for attr in attributes:
print(" ", attr)
lclList=aJob.Operations.OutList
print("aJob.OperationsOutList: ", lclList)
print("aJob.OperationsOutList size: ", lclList.__len__())
if lclList.__len__() > 0:
anOp=lclList[0];
print("anOp: ", anOp)
anOpattributes = [attr for attr in dir(aJob.Operations) if not callable(getattr(aJob.Operations, attr)) and not attr.startswith('__')]
print("Available attributes for aJob.Operations:")
for attr in anOpattributes:
print(" ", attr)
print("Name", anOp.Name)
parent=aJob.Operations.getParent()
print("Parent: ", parent)
print ("++++++++++++++++++++++++++++++++++++++++++====================")
#print("aJob.Operations.Content:", aJob.Operations.Content)
print("aJob.Operations.inlist:", aJob.Operations.InList)
print ("|||||||||||||||||||||||||")
print("aJob.Operations.outlist:", aJob.Operations.OutList)
print ("++++++++++++++++++++++++++++++++++++++++++====================")
#try:
# iter(aJob.Operations)
# print("aJob.Operations is iterable.")
#except TypeError:
# print("aJob.Operations is not iterable.")
print("OrderOutputBy: ", aJob.OrderOutputBy)
print("OutList: ", aJob.OutList)
print("OutListRecursive: ", aJob.OutListRecursive)
print("Parents: ", aJob.Parents)
print("Path: ", aJob.Path)
print("Placement: ", aJob.Placement)
print("PostProcessor: ", aJob.PostProcessor)
print("PostProcessorArgs: ", aJob.PostProcessorArgs)
print("PostProcessorOutputFile: ", aJob.PostProcessorOutputFile)
print("PropertiesList: ", aJob.PropertiesList)
print("Removing: ", aJob.Removing)
print("SetupSheet: ", aJob.SetupSheet)
SetupSheetDir=dir(aJob.SetupSheet)
print("SetupSheetDir: ", SetupSheetDir)
#ret=aJob.SetupSheet.name
#type(ret)
#print(" output path", ret)
print("SetupSheet: ", aJob.SetupSheet)
print("SplitOutput: ", aJob.SplitOutput)
print("State: ", aJob.State)
print("Stock: ", aJob.Stock)
print("Tools: ", aJob.Tools)
print("Type: ", aJob.JobType)
print("TypeId: ", aJob.TypeId)
#print(": ", aJob.)
print("\n\n")
print()
print("-----------------\n\n")
print("=========================================================================\n")
print("=========================================================================\n")
#exit()