Solid bodies to rfa

Solid bodies to rfa

Anonymous
Not applicable
1,223 Views
2 Replies
Message 1 of 3

Solid bodies to rfa

Anonymous
Not applicable

I have multi-body parts with around 10 solid body each. Each solid body has to be converted to rfa. Is it possible in ilogic?

 

 What I did is unchecked the visibility of all solid bodies first, then turn-on the body that need to be converted. After one solid is converted, I switch it off and switch on the next one. I did it over and over until it is done.

0 Likes
Accepted solutions (1)
1,224 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator

So via code you can certainly automate that, but lets pause for a second with a helper idea for the user:

On the Multi-Body part file, look at the Manage ribbon tab, then \ Layout group \ Make Components command.

This will take a multi-body part and generate an assembly with individual part files all linked to this master part file.

Now you have 10 part files and don't have to turn on/off each one to export to rfa (Revit Family file).  I currently don't have the Revit add-in installed, but it too should be available for use with the api as an application addin and/or translator.

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Im sure there is a better way to write this. But for now its all i got.

And its awfully slow, I dont know why. Please fell free to share any idea.

 

Sub Main()
Dim oDoc As PartDocument
oDoc = ThisDoc.Document
oCompDef = oDoc.ComponentDefinition
Dim oBodies As SurfaceBodies = oCompDef.SurfaceBodies

For Each oSolid As SurfaceBody In oBodies
	oSolid.Visible = False
Next

For Each oSolid As SurfaceBody In oBodies
	oSolid.Visible = True
	Dim oSolidName As String = oSolid.Name
'	Dim oBIMOrientType As BIMComponentOrientationTypeEnum
'	oBIMOrientType = kUserCoordinateSystemOrientationType

	Dim FullFileName As String = "C:\Users\Joseph\Desktop\Inventor Study\ToRFA\" & oSolidName & ".rfa"
	oCompDef.BIMComponent.ExportBuildingComponent(FullFileName)
	
	oSolid.Visible = False
Next
For Each oSolid As SurfaceBody In oBodies oSolid.Visible = True Next End Sub

 

 

0 Likes