Message 1 of 3

Not applicable
05-11-2016
11:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone.
I developed my addin using C#2012 and revit api 2016, my addin can create a new document(rvt) using my personal template (rte), The new document must be created with an workset.
i using this code:
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiapp = commandData.Application;
Application app = uiapp.Application;
{
UIApplication uiapp = commandData.Application;
Application app = uiapp.Application;
Document NewDoc = app.NewProjectDocument(@"C:\Temp_eBIM\plantilla_prueba.rte");
Workset.Create(NewDoc,"ejesynivles");
NewDoc.SaveAs(@"C:\Temp_eBIM\WS.rvt");
NewDoc.Close();
uiapp.OpenAndActivateDocument(@"C:\Temp_eBIM\WS.rvt");
Workset.Create(NewDoc,"ejesynivles");
NewDoc.SaveAs(@"C:\Temp_eBIM\WS.rvt");
NewDoc.Close();
uiapp.OpenAndActivateDocument(@"C:\Temp_eBIM\WS.rvt");
return Result.Succeeded;
}
but VB show me this message ( document is not a workshared document.) in the line "Workset.Create(NewDoc,"ejesynivles");"
Maybe the answer is obvious, basic or elementary, but I can not solve it.
someone help me?
someone help me?
Thanks!
Solved! Go to Solution.