There are now two discrete workflows for obtaining a PCF file from Revit piping (or any ductwork, electrical, etc.) - one for exporting from Revit system and RFA families, and one for exporting from ITM/Fap Part content.
Both workflows are covered below. Before you begin, remember the following:
PCF Export of Revit System and RFA Family Content
PCF Export of Revit Fab Parts (ITM) Content (thanks to Martin Schmid for the macro steps)
Note that for this macro to work, you will first need to either create a “C:\Temp” folder on your computer, or edit the last line of code to direct the macro to output the PCF file to whatever existing folder you wish.
Writing the Code
There will be a pre-populated function block created as shown below.
Autodesk.Revit.DB.Fabrication.FabricationUtils.ExportToPCF(
this.ActiveUIDocument.Document,
this.ActiveUIDocument.Selection.GetElementIds().ToList(),
"C:\\temp\\somefile.pcf");
Your end result should look like the following:
That’s it! One line of code (well, four lines to improve readability).
The code will export the selected Pipe Fabrication Part elements to the filename indicated. Feel free to refine this code to change the path or further modify to suit your workflow needs.
Testing the Functionality
Now, you can try it out!
There are now two discrete workflows for obtaining a PCF file from Revit piping (or any ductwork, electrical, etc.) - one for exporting from Revit system and RFA families, and one for exporting from ITM/Fap Part content.
Both workflows are covered below. Before you begin, remember the following:
PCF Export of Revit System and RFA Family Content
PCF Export of Revit Fab Parts (ITM) Content (thanks to Martin Schmid for the macro steps)
Note that for this macro to work, you will first need to either create a “C:\Temp” folder on your computer, or edit the last line of code to direct the macro to output the PCF file to whatever existing folder you wish.
Writing the Code
There will be a pre-populated function block created as shown below.
Autodesk.Revit.DB.Fabrication.FabricationUtils.ExportToPCF(
this.ActiveUIDocument.Document,
this.ActiveUIDocument.Selection.GetElementIds().ToList(),
"C:\\temp\\somefile.pcf");
Your end result should look like the following:
That’s it! One line of code (well, four lines to improve readability).
The code will export the selected Pipe Fabrication Part elements to the filename indicated. Feel free to refine this code to change the path or further modify to suit your workflow needs.
Testing the Functionality
Now, you can try it out!
What does the final block of code look like? I am failing to get it to run without errors. Currently I have:
using System;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using System.Collections.Generic;
using System.Linq;
namespace MyPipingUtilities
{
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.DB.Macros.AddInId("3B6DAEE3-D3B9-4A98-8946-42D551BE4E85")]
public partial class ThisApplication
{
Autodesk.Revit.DB.Fabrication.FabricationUtils.ExportToPCF(
this.ActiveUIDocument.Document,
this.ActiveUIDocument.Selection.GetElementIds().ToList(),
"C:\\temp\\somefile.pcf");
private void Module_Startup(object sender, EventArgs e)
{
}
private void Module_Shutdown(object sender, EventArgs e)
{
}
}
}
What does the final block of code look like? I am failing to get it to run without errors. Currently I have:
using System;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using System.Collections.Generic;
using System.Linq;
namespace MyPipingUtilities
{
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.DB.Macros.AddInId("3B6DAEE3-D3B9-4A98-8946-42D551BE4E85")]
public partial class ThisApplication
{
Autodesk.Revit.DB.Fabrication.FabricationUtils.ExportToPCF(
this.ActiveUIDocument.Document,
this.ActiveUIDocument.Selection.GetElementIds().ToList(),
"C:\\temp\\somefile.pcf");
private void Module_Startup(object sender, EventArgs e)
{
}
private void Module_Shutdown(object sender, EventArgs e)
{
}
}
}
Any update on this? I'm running into the same issue now.
Any update on this? I'm running into the same issue now.
Can't find what you're looking for? Ask the community or share your knowledge.