Main Content

slreportgen.utils.getObjectID

Generate link target ID for Simulink or Stateflow object

Description

example

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.

Note

The slreportgen.report.Diagram and slreportgen.report.ElementDiagram 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.

Examples

Obtain Object ID from Handle

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

    '8bc7ba92e180202ffc5ce217625c6563'

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