Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Import data from Rest API into AutoCAD?

Greg.w.Witkamp
Contributor

Import data from Rest API into AutoCAD?

Greg.w.Witkamp
Contributor
Contributor

I've got data that's stored in a cloud web-app that has Rest API. I want to query that data into AutoCAD to populate a table on the drawing. Does anyone have a path for doing this? I've been combing a variety of forums, but haven't found anything on it. The closest thing I've found is using a ODBC connection to pull in data to AutoCAD, but that seems to require a ODBC driver for the web-app you want to connect to.

 

 

0 Me gusta
Responder
2.207 Vistas
8 Respuestas
Respuestas (8)

TheCADnoob
Mentor
Mentor

Does your solution have to be based in AutoCAD? There may be a more direct rout to your goal going through forge: https://forge.autodesk.com/

 

if forge looks like a solution here is some information from AU about Forge and REST : https://www.autodesk.com/autodesk-university/class/Best-Practices-Forge-REST-APIs-2017

 

If you cannot go that route, I would think you could get something going using Microsoft ODBC and dumping that data to an excel sheet and Data Linking that Sheet. https://blogs.autodesk.com/autocad/autocad-data-linking-exploring-features-benefits-autocad/

 

you may be able to go straight to excel as well depending on the way you are getting the data. I know excel has some features that interface with the web.  : https://www.howtoexcel.org/power-query/how-to-access-a-json-api-with-power-query/

 

CADnoob

EESignature

0 Me gusta

Greg.w.Witkamp
Contributor
Contributor

I thinking I might go along the route of your third suggestion. I am already querying data into excel from the web app, so I don't think it would be much of a leap for me to write something in VBA that I could run in Autocad that calls excel to refresh the query then import the data to an autocad table. I've done plenty of VBA for excel, I'm hoping it's pretty similar for autocad.

0 Me gusta

TheCADnoob
Mentor
Mentor

I have barely scratched the surface of VBA in AutoCAD. If you go that way you may find quicker answers in the VBA forums :https://forums.autodesk.com/t5/vba/bd-p/33

 

CADnoob

EESignature

ChicagoLooper
Mentor
Mentor

So you're talking streaming 'Data' from a server and not talking about AutoCad entities. You might be able to do it with ArcCIS Connector for AutoCAD but I doubt it.  For more qualified responses, you might want to move your question from Vanilla AutoCAD forum to the Map3D forum. Unfortunately, Vanilla AutoCAD won't do. The Map 3D toolset is what you need.

 

REST services don't work well (or don't work at all) with AutoCAD. Furthermore, AutoCAD's connections for WMS are hit-and-miss and for WFS, it's even worse. If you have data hosted on a server, then ask your colleagues whether the same data is available in shapefile format (the easiest if you want to pull your data into modelspace) or even gdb. If you have experience with FDO (Feature Data Objects) then you won't have any issues. If you're a dabbler, then  make sure your question in the Map3D forum begins with 'How to Make a Connection to......."

Chicagolooper

EESignature

0 Me gusta

Greg.w.Witkamp
Contributor
Contributor
Thanks for the link. I've had good success with using VBA in excel and Solidworks. I feel like there is a fairly basic solution if I can tie together excel and autocad by using excel as the portal to get the rest api data into autocad.
0 Me gusta

Greg.w.Witkamp
Contributor
Contributor
I came across the ArcCIS connector while looking for a solution, but it seemed like a specific solution to GIS content so I didn't look into it any further.
0 Me gusta

ChicagoLooper
Mentor
Mentor

Still, your goal is to pull data out, not just to connect to the service (if you can connect at all). REST services are more for ESRI. I'd go for shapefile or gdb.

 

BTW, what's the url to the REST service?

Chicagolooper

EESignature

0 Me gusta

Greg.w.Witkamp
Contributor
Contributor

API.airtable.com

 

 Their output returns a Max of 100 records at a time, so it requires using pagination in the excel query when dealing with more than 100 records.

0 Me gusta