One way to automate this is to create a virtual directory for the project before building it. This is demonstrated in the VStudio.bld sample (using the vbld_CreateVirtualDir system script function).
When building individual web projects, you need to specify the project filename as a URL, like it is stored in a SLN file (i.e.,
http://localhost/ProjectX/ProjectX.csproj), and this may require your IIS server to be updated to allow files with a .csproj extension to be retrieved. These issues don't apply when specifying the local filename of a .SLN file that contains the project.