Import SAT files from the API

Import SAT files from the API

GeomGym
Advocate Advocate
2,053 Views
4 Replies
Message 1 of 5

Import SAT files from the API

GeomGym
Advocate
Advocate

Is it possible to import a SAT file from the API?

 

Thanks,

 

Jon

0 Likes
Accepted solutions (1)
2,054 Views
4 Replies
Replies (4)
Message 2 of 5

Joe.Ye
Alumni
Alumni
Accepted solution
Revit 2014 exposed the API to import SAT file.

public ElementId Import(
string file,
SATImportOptions options,
View pDBView
)

However, Revit 2013 didn't expose this overload of Import()



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Message 3 of 5

Anonymous
Not applicable

Dear Mr. Joe Ye!

May be it is possible to place some example of SAT file import on C# and to link in to some View3D?

 

Some parts for example:

            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Application app = uiapp.Application;
            Document doc = uidoc.Document;

 

SATImportOptions MySAToptions = new SATImportOptions();
MySAToptions.Placement = ImportPlacement.Shared;
MySAToptions.Unit = ImportUnit.Millimeter

 

Doc.Link(String file, SATImportOptions MySAToptions, View some view)

0 Likes
Message 4 of 5

Joe.Ye
Alumni
Alumni


Yes, it is possible to import a SAT file to a Revit specivied view.

Here is the SharpDevelop code showing the solution.

public void ImportSat()
{

Document doc = this.ActiveUIDocument.Document;

SATImportOptions MySAToptions = new SATImportOptions();
MySAToptions.Placement = ImportPlacement.Centered;
MySAToptions.Unit = ImportUnit.Millimeter;

Transaction trans = new Transaction(doc);
trans.Start("ImportSat");

doc.Import(@"c:\test\mysat1.sat",MySAToptions,doc.ActiveView);
trans.Commit();
}

We cannot use Document.Link() method to link a sat file, instead calling Document.Import() method.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Message 5 of 5

Anonymous
Not applicable

Joe;
I can use your method for import a rvt view o schedule specific?. i using version 2015 and 2016 of api.

 

0 Likes