To get started, please check also the following topics about Pixyz concepts and vocabulary:

Pixyz objects types

  • All Pixyz objects are called Entities
  • In Python Scripting, an entity is defined by a unique numerical identifier, or ID
  • The API Reference shows inheritance of entity types


For example, a Part is inherited from Component, so if a function wants a Component parameter you can give it a Part:



Pixyz Scene occurrences

  • Product Structure / Scene nodes are Occurrences
  • An occurrence can have children occurrences
  • An occurrence has properties:
    • Name
    • Transform
    • Material
    • Visible
  • An occurrence owns components (maximum one of each type)        


Pixyz Scene components


  • List of components types:
    • Part
    • PMI
    • Light
    • Metadata
    • Interaction Behavior
    • Visual Behavior


Prototyping

  • Each occurrence can have a prototype, a prototype is also an occurrence
  • A prototype is a kind of pattern
  • An occurrence can override properties of its prototype occurrence

       


See also: About Instances & Prototypes


Pixyz Scene Part

  • A part contains geometry, contained in a Shape
  • A part may contain one or two shapes:
    • A BRepShape with CAD representation
    • A TessellatedShape with Mesh representation
  • The Active shape is the tessellate shape if it exists, the BRep shape otherwise.
  • A part has a local transformation matrix



Common functions for Scene handling

  • Get the type of an entity as a String: 
    • core.getEntityTypeStr(entity)


  • Get/Set a property value (All property values are Strings): 
    • nameValue = core.getProperty(entity, "Name"
    • core.setProperty(entity, "Name", "NameValue")


  • List available properties on an entity:
    • core.listProperties(entity)


Other Python examples


  • Occurrence list with the root: [scene.getRoot()]
  • Occurrence list with all parts: scene.getPartOccurrences()
  • Occurrence list with selection: scene.getSelectedOccurrences()
  • All occurrences: scene.findByProperty(‘Name’, ‘.*’)


Related Topics