import adsk file using api

import adsk file using api

Anonymous
Not applicable
732 Views
2 Replies
Message 1 of 3

import adsk file using api

Anonymous
Not applicable

if anyone knows, can someone please provide me the code on how to open adsk file in autodesk revit using revit api?

Dim b As Document
        b.OpenBuildingComponent("C:\Users\Yogesh\Desktop\3760.adsk")

i tried this thing,but it creates erroor

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

RPTHOMAS108
Mentor
Mentor
<Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)> _
<Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)> _
Public Class EntryPoint_BuildingComponent
    Implements IExternalCommand

    Public Function Execute(commandData As ExternalCommandData, ByRef message As String, elements As ElementSet) As Result Implements IExternalCommand.Execute
        Dim IntApp As UIApplication = commandData.Application
        Dim IntBcDoc As Document = IntApp.Application.OpenBuildingComponentDocument("c:\SampleBrick.adsk")
        'Never have I opened one of these and can't find one to open, so can't verify the above.

        'DocumentType Enumeration has a value for this and is avilable through document opening/creating events.
    End Function
End Class
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

i got the way
Dim
 b As Document
        b = application.Opendocumentfile("C:\Users\Yogesh\Desktop\3760.adsk")

0 Likes