Unfortunately this is not (directly) possible as of now. When the Kotlin DSL code is imported into TC, it's compiled and verified, then its changes get applied to the regular configurations. Changing what is going to run is not possible based on the changesets in TeamCity at all directly, so it's also not possible via the DSL.
Following this blog post, you can create a relatively large amount of custom build configurations. Create one of them for each of the different pipelines you would like to follow, then configure the VCS Trigger on each one to only be triggered by the appropriate type of changes (path/branch).
Unfortunately this is not (directly) possible as of now. When the Kotlin DSL code is imported into TC, it's compiled and verified, then its changes get applied to the regular configurations. Changing what is going to run is not possible based on the changesets in TeamCity at all directly, so it's also not possible via the DSL.
However, there might be an option. https://blog.jetbrains.com/teamcity/2017/01/kotlin-configuration-scripts-creating-configuration-scripts-dynamically/
Following this blog post, you can create a relatively large amount of custom build configurations. Create one of them for each of the different pipelines you would like to follow, then configure the VCS Trigger on each one to only be triggered by the appropriate type of changes (path/branch).