andydandy74 / ClockworkForDynamo

A collection of 450+ custom nodes for the Dynamo visual programming environment
MIT License
219 stars 96 forks source link

Document.SaveAs currently has no capacity to support .rte documents #397

Closed jake1108 closed 6 months ago

jake1108 commented 8 months ago

What is the problem that needs solving? I need the capacity to SaveAs a large number of .rvt documents into .rte for distribution. Currently, within the node the input "Path" is filtered through the codeblock:

path2 = String.Replace(path1,".rvt","");
String.Replace(path2,".rfa","");

This gives no capacity for processing .rte's as the only subsequent review of the document is whether it is a family doc or not.

How would you like to see it solved? I have adjusted the script so that the codeblock manipulating the input path is removed, and instead, the processing is handled within the Python.

Changing:

if doc.IsFamilyDocument:
    path += '.rfa'
else:
    path += '.rvt'

To:

if doc.IsFamilyDocument and ".rvt" in path:
    path = path.replace('.rvt', ".rfa")
else:
    pass

This enables the user to dictate the file type using the ".extension" notation, overriding this only in the case of a user trying to save a familydoc as a project.

Describe alternatives you've considered There are plenty of other ways to achieve the same outcome. I simply wish to have the capacity to save Revit templates directly from .rvt documents. So long as I have this I'm happy :D.

Additional context (Please fill in if applicable. Add any other context or screenshots about the feature request here.)

jake1108 commented 8 months ago

@albandechasteigner your Document SaveAs node behaves in the same way, in case you wanted to include this functionality also.

andydandy74 commented 6 months ago

Solved for project and family templates by adding a new "Save as template" input

grafik