Model.geomupdate#

Model.geomupdate(collection, DataToUpdate='', FileVersionSameAsCAD='', MetadataPrefixFilter='', OutputFolder='', OverWriteRepresentation='', RemoveMetadataPrefix='', UpdateColorFrom='', UpdateMetaDataAsColor='', UpdateMetaDataAsName='', UpdateNameFrom='')#

Update CAD files with modified data. Currently supported formats are Parasolid and NX only. For NX, a valid license and installation is required.

Parameters:
  • collection (Collection) – The collection containing the entities to update. Valid entities are parameters (NX only), parts, components, points, lines, surfaces and solids.

  • DataToUpdate (hwString) –

    None - When entity_type is parameters

    Metadata - For all other entity types

  • FileVersionSameAsCAD (hwString) – If specified, saves the file in the version it was created. Otherwise, saves in the latest version. Valid for Parasolid only.

  • MetadataPrefixFilter (hwString) – The metadata prefix to remove when RemoveMetadataPrefix="on".

  • OutputFolder (hwString) – The directory to write the CAD files when OverWriteRepresentation="off". If not specified the start-in directory is used.

  • OverWriteRepresentation (hwString) –

    off - Do not overwrite representations and write to OutputFolder instead. The new representation files are updated on the corresponding parts for parameter updates.

    on - Overwrite the original representation files. (default)

  • RemoveMetadataPrefix (hwString) –

    off - Do not remove any metadata prefixes. (default)

    on - Remove the metadata prefix specified by MetadataPrefixFilter.

  • UpdateColorFrom (hwString) – The color of the CAD entities are updated based on the color coming from. Valid values are component, part or metadata (UpdateMetaDataAsColor must then be specified). Default is to not update colors.

  • UpdateMetaDataAsColor (hwString) – The metadata to use for updating the color when UpdateColorFrom="metadata".

  • UpdateMetaDataAsName (hwString) – The metadata to use for updating the name when UpdateNameFrom="metadata".

  • UpdateNameFrom (hwString) – The name of the CAD entities are updated based on the name coming from. Valid values are component, part or metadata (UpdateMetaDataAsName must then be specified). Default is to not update names.

Example#

Update parameters with IDs 1 - 3 , overwrite the original representations#
import hm
import hm.entities as ent

model = hm.Model()

model.geomupdate(collection=hm.Collection(model, ent.Parameter, [1, 2, 3]))
Update parameters with IDs 1 - 3 , write new representations to “ C:my_reps “#
import hm
import hm.entities as ent

model = hm.Model()

model.geomupdate(
collection=hm.Collection(model, ent.Parameter, [1, 2, 3]),
OverWriteRepresentation="off",
OutputFolder="C:/my_reps",
)