{"id":20239479,"url":"https://github.com/opensourcebim/bimbots-freecad","last_synced_at":"2025-04-10T19:36:32.405Z","repository":{"id":140671475,"uuid":"170164816","full_name":"opensourceBIM/BIMbots-FreeCAD","owner":"opensourceBIM","description":"A FreeCAD plugin to communicate with BIMbots services","archived":false,"fork":false,"pushed_at":"2024-06-06T13:39:38.000Z","size":5237,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T17:14:43.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opensourceBIM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-11T16:45:49.000Z","updated_at":"2024-06-06T13:39:42.000Z","dependencies_parsed_at":"2024-06-06T15:10:45.540Z","dependency_job_id":"d68cd183-e200-49ef-880c-0b8d047839bb","html_url":"https://github.com/opensourceBIM/BIMbots-FreeCAD","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMbots-FreeCAD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMbots-FreeCAD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMbots-FreeCAD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMbots-FreeCAD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensourceBIM","download_url":"https://codeload.github.com/opensourceBIM/BIMbots-FreeCAD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281414,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T08:39:02.469Z","updated_at":"2025-04-10T19:36:32.383Z","avatar_url":"https://github.com/opensourceBIM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BIMbots-FreeCAD\nA FreeCAD plugin to communicate with BIMbots services - http://bimbots.org/\n\n**Warning - the BIMbots service has been retired and this addon is now obsolete**\n\n![](doc/images/bimbots-ui-01.jpg)\n\nThis FreeCAD plugin allows a user to: \n1. Upload a FreeCAD model or selected parts of a FreeCAD model to a BIMBots instance (usually a [BIMServer](http://bimserver.org/) with external services enabled)  \n2. Perform different services and analyses on their model  \n3. Read said results in FreeCAD (usually in the form of a text report) or a BCF file (not yet supported - see below)  \n\nThis plugin is written in Python and consists of a single all-in-one Python file along with a companion FreeCAD macro for convenience. \nIt can be used in several ways: \n\n### Run BIMBots within FreeCAD\n* The main usage is to work within [FreeCAD](https://www.freecadweb.org) and be simply launched as a macro.  \n* If you have the [BIM Workbench](https://github.com/yorikvanhavre/BIM_Workbench) installed, this BIMBots plugin will be automatically detected at start and you will find a **BIMBots** command under **Utils** menu.\n\n### Run BIMBots from the CLI\nThe BIMBots plugin can also be run directly from the command line terminal, in which case it prints a list of services it was able to reach, or imported as a python module (Python 2 and Python 3 compatible), in which case you have access to several utility functions to retrieve and communicate with BIMbots services. So essentiall this can also be used as a library to build your own BIMBots client.\n\nCheck the [API documentation](doc/documentation.md) page (autogenerated with [pdoc](https://pdoc3.github.io/pdoc/)) and the [FreeCAD GUI documentation](doc/ui-documentation.md).\n\n### How to install\nIn FreeCAD, just head to menu **Tools -\u003e Addons Manager**, locate the BIMBots addon, press the **Install** button, and restart FreeCAD. \n\n### How to use\nOnce installed, you will find a **BIMBots** entry under menu **Macro -\u003e Macros**. If you have the [BIM Workbench](https://github.com/yorikvanhavre/BIM_Workbench) also installed, the BIMBots plugin will be automatically detected at start and you will find a **BIMBots** command under menu **Utils**.  \nRefer to the [documentation](doc/ui-documentation.md) for complete use instructions.  \n\n### Features\n\n#### When used as a Python module, it can:\n\n* Retrive a list of BIMbots services\n* Authenticate with any of the services\n* Keep authentication credentials in a config file\n* Test services (send a minimal test IFC file that is guaranteed to work)\n* Send actual IFC files\n* Get the results\n\n#### When running inside FreeCAD:\n\n* All functionality is available from the GUI\n* Auto-discover available services\n* Add/remove custom servers\n* Authenticate with services\n* Send model data to any service\n* Display JSON or text reports\n* Double-click results (JSON results only) to select corresponding objects in the 3D view\n\n#### To do (help welcome!):\n\n* Handle Context-Id (reuse an already sent model slot)\n* Handle asynchronous connection (don't wait and freeze the FreeCAD interface while data is being transmitted)\n* Implement display of BCF files in FreeCAD (in progess - Part of a [GSOC](https://forum.freecadweb.org/viewtopic.php?f=8\u0026t=35465) project)\n\n#### Quick how-to use from Python\n\n```\n\u003e\u003e\u003e import bimbots\n\u003e\u003e\u003e bimbots.get_service_providers()\n```\n\nThis returns a dictionary containing the different service providers found (both auto-discovered and manually added via the FreeCAD UI):\n\n```\n[{u'listUrl': u'https://ifcanalysis.bimserver.services/servicelist', u'name': u'ifcanalyses'}, \n {u'listUrl': u'http://localhost:8080/servicelist', u'name': u'Default localdev BIMserver', \n  u'description': u'Default localdev BIMserver'}, {u'listUrl': u'http://localhost:8081/servicelist', \n  u'name': u'2nd localdev BIMserver', u'description': u'2nd localdev BIMserver'}, \n {u'listUrl': u'http://localhost:8082/servicelist', u'name': u'Default JAR runner', \n  u'description': u'Default JAR runner'}, {u'listUrl': u'https://thisisanexperimentalserver.com/servicelist', \n  u'name': u'Experimentalserver.com', u'description': u'Experimental BIMserver'}]\n```\nThen, using one of the \"listUrl\" above:\n\n`\u003e\u003e\u003e bimbots.get_services('http://localhost:8082/servicelist')`\n\nThis returns a list of services offered by the given server (adding the /servicelist is optional):\n\n```\n[{u'inputs': [u'IFC_STEP_2X3TC1'], u'resourceUrl': u'http://localhost:8082/services', \n  u'description': u'IFC Analytics Service', u'outputs': [u'IFC_ANALYTICS_JSON_1_0'], \n  u'providerIcon': u'/img/bimserver.png', u'provider': u\"Yorik's test BIMserver\", \n  u'oauth': {u'tokenUrl': u'http://localhost:8082/oauth/access', \n             u'registerUrl': u'http://localhost:8082/oauth/register', \n             u'authorizationUrl': u'http://localhost:8082/oauth/authorize'}, \n  u'id': 2097206, u'name': u'IFC Analytics Service'}, \n {u'inputs': [u'IFC_STEP_2X3TC1'], u'resourceUrl': u'http://localhost:8082/services', \n  u'description': u'BIMserver plugin that provides an analysis of a model and and outputs it into json', \n  u'outputs': [u'UNSTRUCTURED_UTF8_TEXT_1_0'], u'providerIcon': u'/img/bimserver.png', \n  u'provider': u\"Yorik's test BIMserver\", \n  u'oauth': {u'tokenUrl': u'http://localhost:8082/oauth/access', \n             u'registerUrl': u'http://localhost:8082/oauth/register', \n             u'authorizationUrl': u'http://localhost:8082/oauth/authorize'}, \n  u'id': 2162742, u'name': u'Simple Analyses Service'}]\n```\nThe next step, if you want to use a service, is to authenticate with it. This is done in two steps. Step 1 is done using one of the \"registeUrl\" above:\n\n`\u003e\u003e\u003e bimbots.authenticate_step_1('http://localhost:8082/oauth/register')`\n\nThis will return a dict with keys that identify our BIMbots plugin on the given server.\n\n`\u003e\u003e\u003e bimbots.authenticate_step_2('http://localhost:8082/oauth/authorize', 'freecad', 'Simple Analyses Service')`\n\nClient_id and service_name will be returned by the step 1 above. This will pop up a browser window, which will access the given BIMbots server, on which you must have a valid user already logged in. You will land on a page that asks you to confirm. Upon confirmation, you will receive a token and an url. Save them to your config file with:\n\n`\u003e\u003e\u003e bimbots.save_authentication('http://localhost:8082/', 2097206, 'Simple Analyses Service', service_url, token)`\n\nThe first URL is used to bind this service to a given server in the config file. You can use either the server name, as I did above, or the /servicelist URL obtained by the first step above in these instructions. service_id, service_name are obtained in step 1 above, and service_url, token are obtained via the web interface opened in step 2.\n\nAfter you properly registered the service, you can now try sending it a test file:\n\n`send_test_payload('http://localhost:8082/', 2097206)`\n\nThere are more functions to interact with services. Check the [API documentation](doc/documentation.md) for the full list of available functions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourcebim%2Fbimbots-freecad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensourcebim%2Fbimbots-freecad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourcebim%2Fbimbots-freecad/lists"}