function autoblkVirtualConVehStart(varargin)

%   Copyright 2023 The MathWorks, Inc.

TopModel='ConfiguredConventionalVirtualVehicle';
virtualVehicleComposer('','EnableUI',false,'VehClass','Passenger Vehicle',...
    'VehArct','Conventional Vehicle',...
    'ConfigModel',TopModel);

copyfile(autoblkssharedFullPwrAnalysisScriptName('GenerateEnergyReport.m'));

TopModel='ConfiguredConventionalVirtualVehicle';
PwrBlockName=getString(message('autoblks:autoblkVehMask:powAndEne'));

% Add Power Analysis block
block=add_block('simulink/Ports & Subsystems/Subsystem',[TopModel '/' PwrBlockName],'position',[745   479   885   516]);
delete_block([TopModel '/' PwrBlockName '/In1']);
OutPortName=[TopModel '/' PwrBlockName '/Out1'];
OutPortHandles=get_param(OutPortName,'porthandles');
OutportLine=get_param(OutPortHandles.Inport,'Line');
delete(OutportLine);
delete_block(OutPortName);
set_param(block,'LinkStatus','none');
set_param(block,'Openfcn','GenerateEnergyReport');
set_param(block,'ForegroundColor','black');
set_param(block,'BackgroundColor','[0.796078, 0.796078, 0.796078]');
set_param(block,'ShowName','off');
set_param(block,'MaskDisplay','disp(getString(message(''autoblks:autoblkVehMask:powAndEne'')))');

%Add PTBS/Simscape toggle block
ToggleBlockName=getString(message('autoblks:autoblkVehMask:TogglePlant'));
block=add_block('simulink/Ports & Subsystems/Subsystem',[TopModel '/' ToggleBlockName],'position',[1020 481 1160 519]);
delete_block([TopModel '/' ToggleBlockName '/In1']);
OutPortName=[TopModel '/' ToggleBlockName '/Out1'];
OutPortHandles=get_param(OutPortName,'porthandles');
OutportLine=get_param(OutPortHandles.Inport,'Line');
delete(OutportLine);
delete_block(OutPortName);
set_param(block,'LinkStatus','none');
set_param(block,'ForegroundColor','black');
set_param(block,'BackgroundColor','[0.796078, 0.796078, 0.796078]');
set_param(block,'ShowName','off');

PlantVariantSubsystem=[TopModel '/' 'Vehicle'];

if strcmp(get_param(PlantVariantSubsystem,'LabelModeActiveChoice'),'SimulinkPlantModel')
    set_param(block,'MaskDisplay','disp(getString(message(''autoblks:autoblkVehMask:ToggleToSimScapePlant'')))');
elseif strcmp(get_param(PlantVariantSubsystem,'LabelModeActiveChoice'),'SimscapePlantModel')
    set_param(block,'MaskDisplay','disp(getString(message(''autoblks:autoblkVehMask:ToggleToSimulinkPlant'')))');
else
    set_param(block,'MaskDisplay','disp(getString(message(''autoblks:autoblkVehMask:ToggleToSimScapePlant'')))');
end

%Add Openfcn
set_param(block,'Openfcn','autoblkTogglePlantModel(gcb);');

%Bump copyright notice down
open_bd  = find_system(TopModel, 'type', 'block_diagram');
blks     = find_system(TopModel, 'SearchDepth', 1, 'IncludeCommented', 'on');
cpyrtAnn = find_system(TopModel, 'RegExp', 'on', 'FindAll', 'on', 'SearchDepth', 1, ...
    'Type', 'annotation',  'Text', 'Copyright');

if ~isempty(cpyrtAnn)
    cpyrtPos=get_param(cpyrtAnn,'Position');
    cpyrtPos=cpyrtPos+[0 75 0 75];
    set_param(cpyrtAnn,'Position',cpyrtPos);
end

set_param(TopModel,'Zoomfactor','fit to view')

end
