Пример #1
0
  private void start() {
    try {
      client = LocalDevSetup.setupJson("http://localhost:8080");
      client.getSettingsInterface().setGenerateGeometryOnCheckin(false);

      File directory = new File("d:\\testfiles");
      for (File f : directory.listFiles()) {
        process(f, null);
      }
    } catch (ServiceException e) {
      e.printStackTrace();
    } catch (PublicInterfaceNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
  private void dumpToFile(SProject project, long roid) throws SerializerException {
    try {
      IfcModelInterface model = bimServerClient.getModel(project, roid, false, false);
      IfcStepSerializer serializer = new Ifc4StepSerializer(new PluginConfiguration());

      MetaDataManager metaDataManager = new MetaDataManager(bimServer.getPluginManager());
      PackageMetaData packageMetaData = metaDataManager.getPackageMetaData("ifc2x3tc1");

      serializer.init(model, null, bimServer.getPluginManager(), null, packageMetaData, false);
      File output = new File("output");
      if (!output.exists()) {
        output.mkdir();
      }
      serializer.writeToFile(new File(output, roid + ".ifc"), null);
    } catch (BimServerClientException e) {
      e.printStackTrace();
    } catch (UserException e) {
      e.printStackTrace();
    } catch (ServerException e) {
      e.printStackTrace();
    } catch (PublicInterfaceNotFoundException e) {
      e.printStackTrace();
    }
  }