Main Content

setShown

R2026b

Set connector as shown or hidden

Since R2026b

    Description

    setShown(connector,flag) sets the connector connector as shown or hidden depending on the logical flag in the architecture model.

    For more information on how to show and hide connectors on the System Composer™ canvas, see Show and Hide Connector Lines.

    example

    Examples

    collapse all

    Determine whether a connector is shown or hidden in the current architectural diagram.

    Create a model with components, ports, and a connector between them.

    model = systemcomposer.createModel("newModel");
    systemcomposer.openModel("newModel")
    comp1 = model.Architecture.addComponent("Component1");
    comp2  = model.Architecture.addComponent("Component2");
    out1 = comp1.Architecture.addPort("Out1","out");
    in1 = comp2.Architecture.addPort("In1","in");
    outport1 = comp1.getPort("Out1");
    inport1 = comp2.getPort("In1");
    conn1 = outport1.connect(inport1);

    Get whether the connector is shown.

    shown = conn1.getShown
    shown =
    
      logical
    
       1

    Set the connector as hidden.

    conn1.setShown(false)

    Get whether the connector is now shown.

    shown = conn1.getShown
    shown =
    
      logical
    
       0

    Input Arguments

    collapse all

    Connection between ports, specified as a systemcomposer.arch.Connector object.

    Option to set connector as shown or hidden, specified as 1 (true) to set the connector as shown and 0 (false) to set the connector as hidden.

    Data Types: logical

    More About

    collapse all

    Version History

    Introduced in R2026b