To open the workshared model with worksets discarded, you will need to:
- Remove the
/i
option from the commandLine
in your activity. Specify an hardcoded localName
in for your input argument (say input.rvt
). Like so
{
"alias": "prod",
"activity": {
"id": "YourActivity",
"commandLine": [ "$(engine.path)\\\\revitcoreconsole.exe /al $(appbundles[YourBundle].path)" ],
"parameters": {
"rvtFile": {
"zip": false,
"ondemand": false,
"verb": "get",
"description": "Input Revit model",
"required": true,
"localName": "input.rvt",
}
},
"engine": "Autodesk.Revit+2020",
"appbundles": [ "YourName.YourBundle+label" ],
"description": "Bundle description."
}
}
- Open the file
input.rvt
in your app bundle using DetachAndDiscardWorksets
like so:
ModelPath path = ModelPathUtils.ConvertUserVisiblePathToModelPath("input.rvt");
var opts = new OpenOptions
{
DetachFromCentralOption = DetachFromCentralOption.DetachAndDiscardWorksets
};
var document = application.OpenDocumentFile(path, opts);
For related details, you may refer the blog announcement and an earlier related stack overflow answer.
By default, (following the blog announcement) Design Automation will try to open workshared models with DetachAndPreserveWorksets
if the /i
option is provided in the commandLine
. This will however work only if the input file is a central file. It will not work for a local file with worksets, as the file is owned by a certain user.