
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm new to Revit programming and I'm trying to load a family symbol/type through VB macro in Revit 2017 (SharpDevelop).
Code is very simple: I load a beam family or a single symbol/type contained in the family.
Sub LoadFamilySymbol_fp() Dim sFName, sTName As String 'create transaction e load the family Using t As New Transaction (Me.Document, "LoadFamily") If t.Start = TransactionStatus.Started Then sFName = "C:\ProgramData\Autodesk\RVT 2017\Libraries\Italy\Telaio strutturale\Acciaio\Travi HE.rfa" sTName = "HE180A" 'Document.LoadFamilySymbol(sFName,sTName) 'load only a symbol/type contained in the family Document.LoadFamily(sFName) 'load the entire family End If t.Commit End Using End Sub
Code works fine and I get no errors, however the newly loaded family or family symbol/type do not show in Project Browser.
On the other hand, after executing the Sub above, if I try to manually load a family via the Insert > Load Family menu, I get a warning that the family already exists in the project (see attached image).
How this happens? Should I change my code above to tell Revit this family is actually a Structural Framing family?
Thanks in advance for your valuable feedback.
fp
Solved! Go to Solution.