From the Release notes of Dymola 2014 FD01:
3.2.1 Smart Connect
In Dymola 2014, Smart Connect is introduced to simplify connecting objects. The features are enabled by default, but can be disabled generally by setting the flag Advanced.SmartConnect=false.
These features are also disabled when Connect Mode is not selected. Working with the features, Ctrl+Z, or Escape, are the general commands used to undo an action.
Note that if a connection dialog is needed to connect, it is displayed automatically. Only one connection that requires the connection dialog is supported per operation.
By placing a connector on top of a matching connector of another component, a connection is automatically created between the two connectors. In the example below, a capacitor is dragged to fit the connector of a resistor. A short highlight is seen when the connection is created and connected; the result is seen when dragging the capacitor away.
The colour of the highlight indicates degree of success:
- Green: Connection succeeded.
Dymola 2014 Release notes 9
- Yellow: It is possible to create a connection, but not with smart connect. This is the case with, e.g., expandable connectors and array of connectors.
- Red: Connection not possible; e.g. connectors are not matching.
Drop component on connection
A component can be dropped on a connection for automatic connection.
Splitting a connection when dropping a matching component is also supported, e.g., dropping a heating resistor on the connection of two resistors:
will result in:
Two highlights are seen when dropping the component, one for the connection to the right of the component, and one for the connections to the left of the component.
The layout of the original connection is kept. Dropping on a vertical connection is also supported.
The connection is split only if the relevant sub connectors of the dropped component match the connection (in the above example the positive and negative pin).
Two utility features are shown below which, by executing them in the command line, can be used to personalise the performance and settings of SmartConnect, a possibility we have been asked for by customers and users in the past. We do however stress that the default settings are the result of a study to find this optimal tuning of the functionality and moving away from the default values may hinder the ease of use/performance of SmartConnect.
Hidden.SmartConnectBuffer = 25 “Buffer zone in percent around the connectors. Used when matching bounding boxes. Default is 25 percent”;
This utility will give the user the option to increase or decrease the size of the matching connector detection zone to suit their needs. Not that an area too big would potentially cause/propose unwanted connections to be made and hence be detrimental to development time. The default buffer size is set to 25% as this is deemed to be the best compromise for the correct operation of this functionality.
Hidden.SmartConnectTimeout = 100 “Time in milliseconds until a smart connect is attempted. Default is 100 ms”;
This utility parameter allows the user to decrease or increase the amount of time before which a “smart connect” is attempted while two connectors lie within the defined Buffer zone in the diagram layer. Reducing this value too much might cause unwanted smart connections to be made whilst dragging a class over a system model in the diagram layer. 100ms was deemed to be a good compromise for the average user although longer times might be prescribed if unwanted connections are still being made whilst creating system models in the diagram layer.
Advanced.SmartConnect = true (default) or false
The above command will enable (=true) and disable (=false) the SmartConnect functionality if the user prefers to do so. You can set this flag/command permanently for a particular version of Dymola by adding Advanced.SmartConnect = true or Advanced.SmartConnect = false in the Dymola.mos file within the Insert directory of your Dymola installation. Note that in Windows 7 and beyond, editing of Dymola.mos might have to be in a non-restricted area of the hard drive, then the modified version of Dymola.mos can simply be pasted into the Insert directory of your Dymola installation.
A useful command to add to the script Dymola.mos is Advanced.AutoFormatting = true which sets auto formatting to true every time we start the particular version of Dymola using Dymola.mos.
By setting Advanced.AutoFormatting = true we can minimise white space changes for revision control purposes.