MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / cmdline

Function cmdline

src/ifccityjson/ifccityjson/__main__.py:26–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25
26def cmdline():
27 # Example:
28 # python ifccityjson.py -i example/3DBAG_example.json -o example/output.ifc -n identificatie
29 # python ifccityjson.py -i example/geometries.json -o example/geometry_output.ifc
30 parser = argparse.ArgumentParser(description="")
31 parser.add_argument("-i", "--input", type=str, help="input CityJSON file", required=True)
32 parser.add_argument("-o", "--output", type=str, help="output IFC file. Standard is output.ifc")
33 parser.add_argument("-n", "--name", type=str, help="Attribute containing the name")
34 parser.add_argument("--split-lod", dest="split", action="store_true", help="Split the file in multiple LoDs")
35 parser.add_argument(
36 "--no-split-lod", dest="split", action="store_false", help="Do not split the file in multiple LoDs"
37 )
38 parser.add_argument("--lod", type=str, help="extract LOD value (example: 1.2)")
39 parser.set_defaults(split=True)
40 args = parser.parse_args()
41
42 city_model = cityjson.load(args.input, transform=False)
43 data = {}
44 if args.name:
45 data["name_attribute"] = args.name
46 if args.output:
47 data["file_destination"] = args.output
48 if args.lod:
49 data["lod"] = args.lod
50 data["split"] = args.split
51
52 converter = Cityjson2ifc()
53 converter.configuration(**data)
54 converter.convert(city_model)
55
56
57if __name__ == "__main__":

Callers 1

__main__.pyFile · 0.85

Calls 4

configurationMethod · 0.95
convertMethod · 0.95
Cityjson2ifcClass · 0.85
loadMethod · 0.45

Tested by

no test coverage detected