Drafting Views → Save to New File

Greetings,

Wonder if it possible what im trying to do :

Export (Save to New File…) all my Drafting Views by creating separate files.

Here is an example what im trying to achieve :

Using Rhythm package allow me to import views from files but not saving/creating new files.

Would appreciate with any help/direction.

Thanks,

Here is what i have so far using Rhythm package:

Thanks,

Hi @edo ,

Have a look at the link below. I think it’s what you are after.

https://forums.autodesk.com/t5/revit-api-forum/quot-save-to-new-file-quot/td-p/7106258

1 Like

Hi,

Of course it’s possible! It was a nice and fun question, at least I enjoyed it.

If we come to the answer,
The packages you need first:

  • Orchid
  • Rhytm

First you want to specify the file name (I did it according to the Plan names here) and you need to specify which of all the files to create using "Template ". Then I wanted to make sure that the appearance of each of the related appearances was only in the file and I erased all the remaining appearances. In this way, I made the file more useful. (Not necessarily! Just my Fantasy)

1
2

Durmus

2 Likes

Thank You for quick respond. That would be ideal case to create some add-in. Definitely what i want to have. Have to see if i could make something out of it.

Thank You for quick solution and it seems to be workable and might help tremendously now. So i tried to see if i could use for my case and came up with few errors. And can not figure out what its.

  • First thing is that could not find Delete Elements in Documents node so i used Springs.Doc.DeleteElements . Im assuming this might be the case.

  • Yet eventual it does export all files but its all empty. No details. It just copy of “Template.rte”

Probably going to be easy if i share dynamo file itself :
Copy_Views_To_New_Files.dyn

Thank You again for help.

Hİ,

The interesting thing is, I got the file working great. Unfortunately, I don’t have access to the file right now, but I’m going to get back to you at the first opportunity.

Hİ,

This is my fault. Because I copied and pasted the existing elements in the template that I created, but that’s not what you wanted. Import a non-template element into a newly created file. That’s what I jumped. I’ve made a new correction for you. Please try this.


2 3
Durmus

1 Like

Hey !

Thank You for giving another try im appreciated it very much.
Still having some issues that can not yet figure out how to resole it. Somehow its not exporting all details and gives - null


Copy_Views_To_New_Files_2.dyn

Thanks,

Hİ,

An interesting mistake, perhaps because of the version/version difference you are using. I don’t know.
I’m using Dynamo 2.1

Hey !

You might be right. I forgot to mention that Dynamo crashing constantly after a while.

I have latest version:
Dynamo Core 2.0.3.8810
Dynamo Revit 2.0.3.8811

Here is an error :


The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.

at validateNativeInstance(Void* ptr)
at Autodesk.Revit.RevitDBAPIManagedWeakPointer.getValidPtr()
at Autodesk.Revit.DB.Document.GetHashCode()
at System.Collections.Generic.Dictionary2.Remove(TKey key) at ProtoFFI.CLRObjectMarshaler.OnDispose(StackValue dsObject, Context context, Interpreter dsi) at ProtoFFI.DisposeFunctionPointer.Execute(Context c, Interpreter dsi) at ProtoCore.Lang.FFIFunctionEndPoint.Execute(Context c, List1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore)
at ProtoCore.CallSite.ExecWithZeroRI(List1 functionEndPoint, Context c, List1 formalParameters, StackFrame stackFrame, RuntimeCore runtimeCore, SingleRunTraceData previousTraceData, SingleRunTraceData newTraceData)
at ProtoCore.CallSite.Execute(List1 functionEndPoint, Context c, List1 formalParameters, List1 replicationInstructions, StackFrame stackFrame, RuntimeCore runtimeCore) at ProtoCore.CallSite.DispatchNew(Context context, List1 arguments, List1 partialReplicationGuides, DominantListStructure domintListStructure, StackFrame stackFrame, RuntimeCore runtimeCore) at ProtoCore.DSASM.Executive.Callr(Int32 blockDeclId, Int32 functionIndex, Int32 classIndex, Boolean& explicitCall, Boolean isDynamicCall, Boolean hasDebugInfo) at ProtoCore.DSASM.Heap.GCDisposeObject(StackValue svPtr, Executive exe) at ProtoCore.DSASM.Heap.Sweep() at ProtoCore.DSASM.Heap.SingleStep(Boolean forceGC) at ProtoCore.DSASM.Heap.FullGC(IEnumerable1 gcroots, Executive exe)
at ProtoScript.Runners.LiveRunner.ApplyUpdate()
at ProtoScript.Runners.LiveRunner.CompileAndExecuteForDeltaExecution(List`1 astList)
at ProtoScript.Runners.LiveRunner.SynchronizeInternal(GraphSyncData syncData)
at ProtoScript.Runners.LiveRunner.UpdateGraph(GraphSyncData syncData)
at Dynamo.Scheduler.UpdateGraphAsyncTask.HandleTaskExecutionCore()
at Dynamo.Scheduler.AsyncTask.Execute()

Thanks !

Hi,

I believe there are two reasons for this error.

  1. If you’re closing your files in the background as "Manual ", it will crash.
  2. It uses RAM and CPU very seriously when creating new files. If your computer cannot remove this RAM load, the system shuts down directly.

Nevertheless, I believe @Michael_Kirschner2 will give you the right answer.

Hi!
im using workstation with 64gb RAM
Removed/Reinstalled Orchid package and seems like still getting errors:


Got the OrchidForDynamo package from github

Thanks,

Hi,

Unfortunately, I don’t know why this is the problem. I am sad. I suggest you do it up to date and try another PC.

Hey !

Some good news . Switched from Revit18 to Revit19 and problems with dynamo packages resolved. No more errors.
Now its exporting all detail views - copying Template (Template19.rte) but leaving files empty. Does not copy detail/elements itself. Copy Elements Failed

Another thing im trying to achieve is the naming convention by removing “DraftingView(Name = )
and exporting only Detail Name.
For example : DraftingView(Name = S 03 31 30.S03 CORNER REINFORCEMENT ) in to S 03 31 30.S03 CORNER REINFORCEMENT

Thanks !