Main Content


Generate link target ID for Simulink or Stateflow object



id = slreportgen.utils.getObjectID(obj) generates a link target ID for the specified Simulink® or Stateflow® object. The ID is hashed so that it does not exceed the 40-character limit imposed on Microsoft Word bookmarks.


The and reporters use this utility to generate IDs for element hyperlinks in diagrams generated for HTML and PDF reports. You can use this function to generate corresponding link targets for the diagram elements.

To create a link target for a Truth Table block in a Simulink diagram, specify the Truth Table block path and not the Stateflow.TruthTable object.

id = slreportgen.utils.getObjectID(obj,"Hash",false) does not hash the generated ID.


Obtain Object ID from Handle

modelHandle = slreportgen.utils.getSlSfHandle('f14');
objID = slreportgen.utils.getObjectID(modelHandle)
objID =


Input Arguments

collapse all

Simulink or Stateflow object, specified by its path or handle, for which to generate a link target ID.

Output Arguments

collapse all

Simulink or Stateflow link target ID, returned as a character vector. You use this character vector as the anchor ID for linking.

Version History

Introduced in R2018b