MATLAB: How do you add physical signal lines programmatically

MATLABphysical signalprogrammingSimscapeSimscape Multibodysimulationsimulink

I just need to connect a Simulink-PS Converter to a Connector port in a subsystem, but the usual add_line function doesn't work. It returns an error, saying the object doesn't exist.
add_line('mymodel/mySubsystem','C_1','Conn_1', 'autorouting', 'on');
This is the specific error:
Invalid Simulink object name: C_1/1

Best Answer

Figured it out. Simscape blocks use "/RConn1", "/LConn1", etc. to denote ports, while Simulink blocks use "/1", "/2", etc. The converter blocks use both depending on which side you're referencing.