Revit MEP Forum
Welcome to Autodesk’s Revit MEP Forums. Share your knowledge, ask questions, and explore popular Revit MEP topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Export BOTH Revit MEP System Families & RFAs to PCF, AND How to Export Revit Fab Parts to PCF

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
1610 Views, 2 Replies

How to Export BOTH Revit MEP System Families & RFAs to PCF, AND How to Export Revit Fab Parts to PCF

Anonymous
Not applicable

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:

  • both Revit and Fabrication CADmep need to be the same release, 
  • you have to have installed Revit first, then Fabrication CADmep. If you installed Fabrication CADmep first, then as long as Revit is installed now, just uninstall and reinstall Fabrication CADmep.
  • And finally, all piping in every system selection you want to export, first needs to be connected in Revit. If a system family or Fab Part run does not tab through when you select it, you will first need to edit that in Revit.

 

PCF Export of Revit System and RFA Family Content

  • Select all of the pipe route you want to export to PCF. You can use tab-select to select as much of a run as you want, or window it and filter.
  • Under the Add-Ins tab in Revit, on the “RME to FAB” panel, select “Store Graphic Elements” to store all RFA elements of the selected pipe run such as pipe accessories, fittings, fixtures, etc.
  • Then again on the “RME to FAB” panel, with the same run still selected, click “Store Design Line Elements” to store all pipe elements of the run (stores the pipe routing vectors).
  • Now that all the elements you wish to export are stored, on the “RME to FAB” panel select the “OUT” tool to export the RIF file.
  • Enter the file name and location you want to store the RIF file.
  • For the remaining three steps, you can also refer to the Autodesk Knowledge Network – PCF Export page.
  • Now open/switch applications from Revit to Fabrication CADmep and in a new or existing drawing file, type in the command “PROCESSRUN” and point to the RIF file to import it into the current drawing. (Note: you can save the dwg file if you want at this point, but it is not necessary if all you want is just a PCF export.)
  • Next, either type in the command PCFEXPORT, or right-click on any blank drawing area and select CADmep -> Utilities -> Export PCF File.
  • You now have a PCF file wherever you chose to store this output.

 

PCF Export of Revit Fab Parts (ITM) Content (thanks to Martin Schmid for the macro steps)

  1. On the Manage tab > Macro panel > click Macro Manager.
  2. In the Macro Manager window:
    • Select the Application tab.
    • On the right side, under Module, click Create.
  3. In the Create a New Module window:
    • Enter the name MyPipingUtilities
    • Leave the Language as C#.
    • Click OK.
  4. In the Macro Manager window:
    • On the right side, under Module, click Macro
  5. In the Create a New Macro window:
    1. Enter the name ExportSelectionToPCF
    2. Click OK.
  1. The SharpDevelop macro editing environment will open.

 

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.

wwspier_0-1610853781706.jpeg

 

  1. Between the curly braces, copy and paste the following code:

             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:

wwspier_1-1610853781711.jpeg

 

That’s it! One line of code (well, four lines to improve readability).

  1. In the SharpDevelop menu.
    • Click Build > Build Solution
    • Click File > Exit
  2. Click Yes if prompted to save your changes.

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!

  1. In a model with some Pipe Fabrication Parts.
    • Select the elements you want to output.
    • On the Manage tab > Macros panel > click Macro Manager
    • Select the Application tab
    • Expand (if necessary) the tree so you can select ExportSelectionToPCF under MyPipingUtilities.
    • Click Run.
  2. Verify that the file was created in the specified location.

How to Export BOTH Revit MEP System Families & RFAs to PCF, AND How to Export Revit Fab Parts to PCF

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:

  • both Revit and Fabrication CADmep need to be the same release, 
  • you have to have installed Revit first, then Fabrication CADmep. If you installed Fabrication CADmep first, then as long as Revit is installed now, just uninstall and reinstall Fabrication CADmep.
  • And finally, all piping in every system selection you want to export, first needs to be connected in Revit. If a system family or Fab Part run does not tab through when you select it, you will first need to edit that in Revit.

 

PCF Export of Revit System and RFA Family Content

  • Select all of the pipe route you want to export to PCF. You can use tab-select to select as much of a run as you want, or window it and filter.
  • Under the Add-Ins tab in Revit, on the “RME to FAB” panel, select “Store Graphic Elements” to store all RFA elements of the selected pipe run such as pipe accessories, fittings, fixtures, etc.
  • Then again on the “RME to FAB” panel, with the same run still selected, click “Store Design Line Elements” to store all pipe elements of the run (stores the pipe routing vectors).
  • Now that all the elements you wish to export are stored, on the “RME to FAB” panel select the “OUT” tool to export the RIF file.
  • Enter the file name and location you want to store the RIF file.
  • For the remaining three steps, you can also refer to the Autodesk Knowledge Network – PCF Export page.
  • Now open/switch applications from Revit to Fabrication CADmep and in a new or existing drawing file, type in the command “PROCESSRUN” and point to the RIF file to import it into the current drawing. (Note: you can save the dwg file if you want at this point, but it is not necessary if all you want is just a PCF export.)
  • Next, either type in the command PCFEXPORT, or right-click on any blank drawing area and select CADmep -> Utilities -> Export PCF File.
  • You now have a PCF file wherever you chose to store this output.

 

PCF Export of Revit Fab Parts (ITM) Content (thanks to Martin Schmid for the macro steps)

  1. On the Manage tab > Macro panel > click Macro Manager.
  2. In the Macro Manager window:
    • Select the Application tab.
    • On the right side, under Module, click Create.
  3. In the Create a New Module window:
    • Enter the name MyPipingUtilities
    • Leave the Language as C#.
    • Click OK.
  4. In the Macro Manager window:
    • On the right side, under Module, click Macro
  5. In the Create a New Macro window:
    1. Enter the name ExportSelectionToPCF
    2. Click OK.
  1. The SharpDevelop macro editing environment will open.

 

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.

wwspier_0-1610853781706.jpeg

 

  1. Between the curly braces, copy and paste the following code:

             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:

wwspier_1-1610853781711.jpeg

 

That’s it! One line of code (well, four lines to improve readability).

  1. In the SharpDevelop menu.
    • Click Build > Build Solution
    • Click File > Exit
  2. Click Yes if prompted to save your changes.

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!

  1. In a model with some Pipe Fabrication Parts.
    • Select the elements you want to output.
    • On the Manage tab > Macros panel > click Macro Manager
    • Select the Application tab
    • Expand (if necessary) the tree so you can select ExportSelectionToPCF under MyPipingUtilities.
    • Click Run.
  2. Verify that the file was created in the specified location.
2 REPLIES 2
Message 2 of 3
Iev60047
in reply to: Anonymous

Iev60047
Advocate
Advocate

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)
		{

		}

		 
	}
}

 

0 Likes

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)
		{

		}

		 
	}
}

 

Message 3 of 3
nkirkvold
in reply to: Iev60047

nkirkvold
Observer
Observer

Any update on this? I'm running into the same issue now.

0 Likes

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.

Post to forums  

Autodesk Design & Make Report