Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Revit export with RemoveInternalParts

RasmusBredal
Advocate

Revit export with RemoveInternalParts

RasmusBredal
Advocate
Advocate

Hi 

 

I'm trying to make an export of an assembly to *.rvt with the api, it almost work but when I set:

oRevitExportDef.RemoveInternalParts = True 

 The export still include all Internal Parts and when editing the export, the mark is not set:

Rasmus_0-1675854166500.png

 

Code sample 

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

' Actiate the Master model state if the active model state is substitute.
If oDoc.ComponentDefinition.ModelStates.ActiveModelState.ModelStateType = ModelStateTypeEnum.kSubstituteModelStateType Then
    oDoc.ComponentDefinition.ModelStates.Item(1).Activate
    oDoc = ThisApplication.ActiveDocument
End If

Dim oRevitExportDef As RevitExportDefinition
oRevitExportDef = oDoc.ComponentDefinition.RevitExports.CreateDefinition

oRevitExportDef.Location = "C:\Temp"
oRevitExportDef.FileName = "MyRevitExport.rvt"
oRevitExportDef.Structure = kEachTopLevelComponentStructure
oRevitExportDef.EnableUpdating = True
oRevitExportDef.RemoveInternalParts = True

' Create RevitExport.
Dim oRevitExport As RevitExport
oRevitExport = oDoc.ComponentDefinition.RevitExports.Add(oRevitExportDef)

  

0 Likes
Reply
195 Views
0 Replies
Replies (0)