use of org.bimserver.plugins.services.BimServerClientInterface in project BIMserver by opensourceBIM.
the class Tmp method main.
public static void main(String[] args) {
BimServerClientInterface bimServerClient = LocalDevSetup.setupJson("http://localhost:8080");
// Create a project
try {
SProject project = bimServerClient.getServiceInterface().addProject("test" + Math.random(), "ifc2x3tc1");
// Look for a deserializer
SDeserializerPluginConfiguration deserializer = bimServerClient.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
// Checkin file
bimServerClient.checkin(project.getOid(), "test", deserializer.getOid(), false, Flow.SYNC, Paths.get("../TestData/data/AC11-Institute-Var-2-IFC.ifc"));
// Refresh project
project = bimServerClient.getServiceInterface().getProjectByPoid(project.getOid());
// Load model without lazy loading (complete model at once)
IfcModelInterface model = bimServerClient.getModel(project, project.getLastRevisionId(), false, false);
System.out.println(model.getAllWithSubTypes(IfcWall.class).size());
} catch (ServerException | UserException | PublicInterfaceNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (BimServerClientException e) {
e.printStackTrace();
}
}
Aggregations