NateLiquidGravity
Alibre Super User
My problem seems to be finding the AssembledPart ( IInstance ) from a user selected face, edge, point...
Take the following example. If I don't add "<1>" to the end of MyPart.Name then it won't return an AssembledPart. But at that point i'm just guessing they want the first instance of that part.
Also I can use ThisAssy = CurrentAssembly() to get the current assembly but I can't figure out how to get the IInstance of the current assembly to constrain to it.
Any help would be very appreciated.
Take the following example. If I don't add "<1>" to the end of MyPart.Name then it won't return an AssembledPart. But at that point i'm just guessing they want the first instance of that part.
Code:
Win = Windows()
Options = []
Options.append(['Select a Face', WindowsInputTypes.Face, None])
Values = Win.OptionsDialog('My Utility', Options, 400)
if Values == None:
sys.exit()
MyFace = Values[0]
MyFaceName = MyFace.Name
print(MyFaceName)
MyPart = Values[0].GetPart()
print(MyPart)
MyAssem = Values[0].GetSelectionAssembly()
print(MyAssem)
MyAssemPart = MyAssem.GetPart(MyPart.Name+"<1>")
print(MyAssemPart)
MyAssem.MovePart(MyAssemPart,10,10,10,0)
Also I can use ThisAssy = CurrentAssembly() to get the current assembly but I can't figure out how to get the IInstance of the current assembly to constrain to it.
Any help would be very appreciated.