Code example:

procedure TMainFrm.Button1Click(Sender: TObject); 
var 
  StartShape,EndShape,ALinkLineShape:TMyShape; 
begin 
  ALinkLineShape:=MyCAD1.GetSelectedShape; 
  StartShape:=TMyLinkLine(ALinkLineShape).GetStartShape; 
  if StartShape= nil then 
    ShowMessage('No start shape linked!') 
  else 
    ShowMessage(StartShape.Name); 
  EndShape:=TMyLinkLine(ALinkLineShape).GetEndShape; 
  if EndShape= nil then 
    ShowMessage('No end shape linked!') 
  else 
    ShowMessage(EndShape.Name); 
end;