Message 1 of 6

Not applicable
09-07-2015
02:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
My code is written to create a space inside a linked element. This is an error I get when using the NewSpace() method.
I call the method inside a Transaction in the main document and It does nothing to the error.
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
Document doc = uidoc.Document;
foreach (Document d in app.Documents)
{
using (Transaction t = new Transaction(doc, "New Space")) { t.Start(); Autodesk.Revit.Creation.Document docu = d.Create; Space sp = docu.NewSpace(... ,...);
t.Commit();
} }
Could this error be due to that I am calling NewSpace() in the Linked element but the Transaction is in the primary document?.
Revit does not seem to allow me use transactions in anything but the primary document.
If anyone has any suggestions of how I might be able to edit the linked element successful I would be very appreciative.
Thanks, Jack
Solved! Go to Solution.