While assembling a model with different sub-assemblies, it is often necessary to connect or refer entities in one container to entities in another container. To retain modularity of the container entity so that they can be reused in a different context, it is recommended that you define connections to external entities by declaring them as attachments.
A physical analogy to attachments are ports (or plug-in points) on an electronic device. These ports are local or internal to the device and act as media to connect an external device.
The image below shows a Cylinder 1 system in a four cylinder engine model. The Crankshaft and Engine Case bodies are external to the Cylinder 1 system. To define joints or forces between any of these bodies and bodies inside the Cylinder 1 system: attachments with variable names b_crankshaft and b_enginecase are declared as attachments to the system, and these two bodies are referred to as the variable entity.
See System and Assembly Panel - Attachments to learn about managing attachments.
Note | The entity panel for the entity in the container shows a referred attachment entity with blue shading, as shown below: |
In the MDL, the attachment is defined by *Attachment statement in the container entity definition block.
An attachment for a container entity can carry an attachment tag that can help resolve attachments automatically. The attachment tag works in conjunction with the attachment candidate tag that is defined on an entity in a different container. MotionView finds entities that have the same string in the attachment candidate as that of the attachment tag and lists them as Recommended Entities in the model tree while resolving the attachment.
Shown below is the Cylinder 1 Assembly which seeks a Crank pin attachment point. This attachment (variable p_cp_att) has a “CrankPin” attachment tag. The crank pin point in the crank shaft assembly has a attachment candidate tag that has the value “CrankPin”.
Upon clicking the point collector for this attachment, the model tree that is automatically displayed in the Select a Point dialog will have a Recommended Entities folder which lists the crank pin point in the crankshaft assembly.
In addition, the right-click context for any container in the Project Browser also has an Apply Attachment Candidates option.
This option resolves all attachments for a container automatically, by finding entities with attachment candidates that have the same string as that of attachment tag on attachments. If there is more than one entity as candidate for an attachment, a dialog is displayed which allows you to resolve it manually.
An entity is declared as attachment candidate by using the Attachment Candidates button in the entity panel.
1. | Select the entity that has to be declared as attachment candidate. |
2. | Click Attachment Candidates button in the panel. |
The Attachment Candidates dialog is displayed
3. | Click Add . |
A tag entry is included in the dialog.
4. | Click on the Tag field (indicated by <PleaseEnterTag>) and enter in a string. |
5. | From the Location drop-down menu, select single, pair, left, or right. |
- | For single entity types, single is the only option that is available. |
- | For pair entities, the tag can be applied for the pair, or left, or right. |
6. | Click Close. |
The attachment candidate is created on the entity
Note | In MDL, the attachment candidate is created by *AttachmentCandidate statement. The tag value is set using the *SetAttachmentCandidateTag statement. |