- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've created an external rule "Export to RVT" which exports an assembly to RVT. This works perfectly. All the assemblies I want to eventually export to RVT are placed in one main assembly. So what I would like to do is either write some code which directly exports every top level subassembly to RVT. Or write some code that will run this external rule I have in every top level subassembly. Ideally it would go one step further and filter out subassemblies based on the filename or part number, for example only the ones that start with "V1_". I'm not really sure where to start on this one, but my end goal would be that I run one rule and all the necessary top level subassemblies will be exported to RVT.
Can anyone get me started on this?
The code in my external rule is this:
Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = oAsmDoc.ComponentDefinition ' Create RevitExportDefinition Dim oRevitExportDef As RevitExportDefinition oRevitExportDef = oAsmCompDef.RevitExports.CreateDefinition oRevitExportDef.Location = "C:\Temp" oRevitExportDef.FileName = iProperties.Value("Project", "Part Number") & ".rvt" oRevitExportDef.ActiveDesignViewRepresentation = "Default" oRevitExportDef.IsAssociativeDesignView = True oRevitExportDef.Structure = kEachTopLevelComponentStructure oRevitExportDef.UseColorOverrideFromSourceComponent = False oRevitExportDef.EnableUpdating = False ' Create RevitExport. Dim oRevitExport As RevitExport oRevitExport = oAsmDoc.ComponentDefinition.RevitExports.Add(oRevitExportDef)
Solved! Go to Solution.