oldfox
Alibre Super User
I need the correct syntax for line 5 for this to work.
Here's the script:
****************************************************************************************************************
# open an existing assembly
Asm = Assembly(r'C:\Users\Chris\Desktop\Animation', 'Main Unit')
# This is the hierarchy of the part, drilling down thru the file "Main Unit.AD_ASM"
Item = Asm.GetPart('001 - Rotating Parts<1>, 01 - Crankshaft<1>, Part 19 - Crankshaft<1>')
for loop in range(0, 3):
for z in range(0, 36):
Asm.RotatePart(Item, 0, 0, 10)
****************************************************************************************************************
And here's the error report
****************************************************************************************************************
IronPython 2.7.7.0 Interactive Console
For documentation visit http://docs.python.org/2.7
The complete standard library is available
Console commands available:
history - Prints history of entered commands
cls - Clears the screen
help - Shows the list of console commands
run - Executes the current script
>>>
Traceback (most recent call last):
File "<string>", line 5, in <module>
Exception: Part 001 - Rotating Parts<1>, 01 - Crankshaft<1>, Part 19 - Crankshaft<1> was not found.
>>>
****************************************************************************************************************
The model opens and I can *manually* rotate "Part 19 - Crankshaft<1>" perfectly. So I assume it is only the
syntax that's wrong. That is, if this script can even be written to drill down through 3 sub-assemblies.
Thanks
Here's the script:
****************************************************************************************************************
# open an existing assembly
Asm = Assembly(r'C:\Users\Chris\Desktop\Animation', 'Main Unit')
# This is the hierarchy of the part, drilling down thru the file "Main Unit.AD_ASM"
Item = Asm.GetPart('001 - Rotating Parts<1>, 01 - Crankshaft<1>, Part 19 - Crankshaft<1>')
for loop in range(0, 3):
for z in range(0, 36):
Asm.RotatePart(Item, 0, 0, 10)
****************************************************************************************************************
And here's the error report
****************************************************************************************************************
IronPython 2.7.7.0 Interactive Console
For documentation visit http://docs.python.org/2.7
The complete standard library is available
Console commands available:
history - Prints history of entered commands
cls - Clears the screen
help - Shows the list of console commands
run - Executes the current script
>>>
Traceback (most recent call last):
File "<string>", line 5, in <module>
Exception: Part 001 - Rotating Parts<1>, 01 - Crankshaft<1>, Part 19 - Crankshaft<1> was not found.
>>>
****************************************************************************************************************
The model opens and I can *manually* rotate "Part 19 - Crankshaft<1>" perfectly. So I assume it is only the
syntax that's wrong. That is, if this script can even be written to drill down through 3 sub-assemblies.
Thanks