Model.pastefromclipboard#
- Model.pastefromclipboard(targetmodel='', connectors_checkattribute=False, connectors_layercheck=False, connectors_thicknesscheck=False, connectors_tolerance=0.0, dropincomingmodulehierarchy='', mergemode_comps='', mergemode_connectors='', mergemode_geometryandmesh='', mergemode_mats='', mergemode_modules='', mergemode_props='', respectincomingparentmodule='')#
Paste entities from the clipboard to a target or current model.
- Parameters:
targetmodel (hwString) – The name of the target model. If not specified, the entities are pasted in the current model.
connectors_checkattribute (bool) – Determines if connector attributes are compared when deciding if they are the same.
connectors_layercheck (bool) – Determines if connector layers are compared when deciding if they are the same.
connectors_thicknesscheck (bool) – Determines if connector thicknesses are compared when deciding if they are the same.
dropincomingmodulehierarchy (hwString) – This is for special cases that need to drop any incoming module hierarchy, but keep the contents. Possible values are yes and no.
connectors_tolerance (double) – Specifies the tolerance to use when deciding if connectors are the same.
mergemode_comps (hwString) – Specifies how to merge the attributes of components identified as the same. Possible values are keepexisting, keepincoming and keepboth.
mergemode_connectors (hwString) – Specifies how to merge the attributes of connectors identified as the same. Possible values are keepexisting, keepincoming and keepboth.
mergemode_geometryandmesh (hwString) – Specifies how to merge the contents of components identified as the same. Possible values are keepexisting, keepincoming and keepboth. This option is valid only in case that
mergemode.compsis either keepexisting or keepincoming. Whenmergemode.compsis keepboth, there will be separate components anyway.mergemode_mats (hwString) – Specifies how to merge the attributes of materials identified as the same. Possible values are keepexisting, keepincoming and keepboth.
mergemode_modules (hwString) – Specifies how to merge the attributes of parts identified as the same. Possible values are keepexisting and keepboth.
mergemode_props (hwString) – Specifies how to merge the attributes of properties identified as the same. Possible values are keepexisting, keepincoming and keepboth.
respectincomingparentmodule (hwString) – This is used to guide component conflict resolution. This is necessary when an incoming component belongs to a different part, in comparison with the same component in the session. In this case the conflict is resolved either by respecting the incoming parent part or the in-session one. Possible values are yes and no.
Example#
Paste entities from the clipboard to model “ newmodel ” and keep the attributes of the incoming components#import hm import hm.entities as ent model = hm.Model() model.pastefromclipboard(targetmodel="newmodel", mergemode_comps="keepincoming")