Classes | |
class | HashingComponent |
A primer class that has a decorator for hashing the object during the edit method. More... |
Functions | |
def | AddPairsOfComponentsToMember |
def | CopyPairsOfComponentsToMember |
def | Deselect |
def | Erase |
def | ExplodeComponent |
def | GetComponentsOnMember |
def | GetLockedAndRefreshed |
def | GetRegisteredClasses |
def | GetSelectedComponents |
def | hash_object_attrs |
def | LocateMultiple |
def | LocateSingle |
def | LockModifies |
def | PrepareComponentForMember |
def | ReferencePointInGlobal |
def | RegisterComponentType |
def | RegisteredClassDescription |
def | ReplaceLiveComponentsWithCopy |
def | Select |
def HashingComponent.AddPairsOfComponentsToMember | ( | list_of_pairs_of_components_and_member_number | ) |
Add components to multiple members in one transaction and return deep copies of the actual instances added to the members. The return value is useful if the calling code needs to know the uuid of the added component. If a particular component cannot be added to a specific member (see IsAllowedOnMember) None will be returned instead of a deep copy. Example: Add the selected components to member 1 and print uuids of the added components print [str(c.uuid) for c in AddPairsOfComponentsToMember([(GetSelectedComponents(), 1)])[0] if c is not None]
def HashingComponent.CopyPairsOfComponentsToMember | ( | list_of_pairs_of_components_and_member_number | ) |
Copy components to multiple members in one transaction and return deep copies of the actual instances added to the members. The return value is useful if the calling code needs to know the uuid of the added component. If a particular component cannot be added to a specific member (see IsAllowedOnMember) None will be returned instead of a deep copy. Use this method instead of AddPairsOfComponentsToMember to ensure OnMemberCopy is called after the component is added to the member. Example: Copy the selected components to member 1 and print uuids of the added components print [str(c.uuid) for c in CopyPairsOfComponentsToMember([(GetSelectedComponents(), 1)])[0] if c is not None]
def HashingComponent.Deselect | ( | args | ) |
Remove the component(s) from the current selection. Example: Deselect all the currently selected components Deselect(GetSelectedComponents())
def HashingComponent.Erase | ( | args | ) |
Erase the component(s) from the job and return the actual instances of the erased component(s). A component's member and Modifies list must be locked prior to erasing. Example: Erase the selected components Erase(LockModifies(GetSelectedComponents()))
def HashingComponent.ExplodeComponent | ( | component | ) |
Convert all solids created by the component into user solids and remove the component from its host member
def HashingComponent.GetComponentsOnMember | ( | member_number | ) |
Return deep copies of the components on the specified member.
def HashingComponent.GetLockedAndRefreshed | ( | args | ) |
Return locked and refreshed deep copies of the specified components. Example: Changing an existing component's state c = GetLockedAndRefreshed(GetSelectedComponents()[0]) c.ref_point = Point3D.Point3D() ReplaceLiveComponentsWithCopy([c])
def HashingComponent.GetRegisteredClasses | ( | args | ) |
Return the component classes registered with SDS2 Example: map(RegisteredClassDescription, GetRegisteredClasses())
def HashingComponent.GetSelectedComponents | ( | args | ) |
Return deep copies of the selected components.
def HashingComponent.hash_object_attrs | ( | args | ) |
hash_object_attrs(args)
def HashingComponent.LocateMultiple | ( | prompt, | |
filter_function | |||
) |
Prompt the user to select multiple components satisfying the given condition and return True iff the user made a selection. Example: Prompt user to select any component LocateMultiple("prompt", lambda x: True)
def HashingComponent.LocateSingle | ( | prompt, | |
filter_function | |||
) |
Prompt the user to select one component satisfying the given condition and return True iff the user made a selection. Example: Prompt user to select any component LocateSingle("prompt", lambda x: True)
def HashingComponent.LockModifies | ( | args | ) |
Lock the modified members of the component(s) or throw an exception. Return the specified component(s).
def HashingComponent.PrepareComponentForMember | ( | component, | |
member_number | |||
) |
Set the component's member number and reset the uuid
def HashingComponent.ReferencePointInGlobal | ( | component | ) |
If the component is on a member return its ref_point in global coordinates. Example: Visualize the ref_point in global coordinates point.PointLocate( 'ref_point is anchor' , point.Point(ReferencePointInGlobal(GetSelectedComponents()[0])))
def HashingComponent.RegisterComponentType | ( | component_subclass, | |
description | |||
) |
Make the specified component subclass available from the component add dialog with the preferred description and return the description that was actually registered. The preferred description will be the returned description unless a previously added component is already using the description. Example: Register a component and print the description SDS2 will display in the component add dialog print RegisterComponentType(SomeComponent, 'Some component')
def HashingComponent.RegisteredClassDescription | ( | class | ) |
Return the registered description for the specified component class Example: map(lambda c: RegisteredClassDescription(c.__class__), GetSelectedComponents())
def HashingComponent.ReplaceLiveComponentsWithCopy | ( | args | ) |
Update the live components associated with deep copies of the specified components. Return the replaced components. Example: Change an existing component's state c = GetLockedAndRefreshed(GetSelectedComponents()[0]) c.ref_point = Point3D.Point3D() replaced = ReplaceLiveComponentsWithCopy([c])[0]
def HashingComponent.Select | ( | args | ) |
Add the component(s) to the current selection. Example: Select all components on every member in the current view Select(sum([GetComponentsOnMember(m.number) for m in model.members(1)],[]))