SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
Classes | Functions
HashingComponent Namespace Reference

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

Function Documentation

def HashingComponent.AddPairsOfComponentsToMember (   list_of_pairs_of_components_and_member_number)
Returns
Instance of type object
     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)
Returns
Instance of type object
     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)
Returns
Instance of type object
     Remove the component(s) from the current selection.
     Example: Deselect all the currently selected components
     Deselect(GetSelectedComponents())
def HashingComponent.Erase (   args)
Returns
Instance of type object
     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)
Returns
Instance of type object
     Convert all solids created by the component into user solids and
     remove the component from its host member
def HashingComponent.GetComponentsOnMember (   member_number)
Returns
Instance of type list
     Return deep copies of the components on the specified member.
def HashingComponent.GetLockedAndRefreshed (   args)
Returns
Instance of type object
     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)
Returns
Instance of type list
     Return the component classes registered with SDS2
     Example: map(RegisteredClassDescription, GetRegisteredClasses())
def HashingComponent.GetSelectedComponents (   args)
Returns
Instance of type list
     Return deep copies of the selected components.
def HashingComponent.hash_object_attrs (   args)
 hash_object_attrs(args)
def HashingComponent.LocateMultiple (   prompt,
  filter_function 
)
Returns
Instance of type bool
     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 
)
Returns
Instance of type bool
     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)
Returns
Instance of type object
     Lock the modified members of the component(s) or throw an exception.
     Return the specified component(s).
def HashingComponent.PrepareComponentForMember (   component,
  member_number 
)
Returns
Instance of type object
     Set the component's member number and reset the uuid
def HashingComponent.ReferencePointInGlobal (   component)
Returns
Instance of type Point3D
     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 
)
Returns
Instance of type str
     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)
Returns
Instance of type str
     Return the registered description for the specified component class
     Example: map(lambda c: RegisteredClassDescription(c.__class__), GetSelectedComponents())
def HashingComponent.ReplaceLiveComponentsWithCopy (   args)
Returns
Instance of type object
     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)
Returns
Instance of type object
     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)],[]))