Our Free Cloud-based REST APIs offering the capabilities to manipulate AutoCAD files. The APIs enable you to work with popular AutoCAD formats including DWG, DWF, DXF, DWT, DGN, IGES (IGS), PLT, Industry Foundation Classes (IFC), and STereoLithography (STL), OBJ, and CF2. It empowers you to scale, resize, rotate, flip, and edit the drawings. Another exciting aspect is a $0 initial cost, and we can get started without spending a dime.
This blog post explains following topics in more details
Supported file formats
The APIs are fully capable of supporting 3D Solid objects such as Conic, Sphere, Torus, Cylinder, Box, Wedges in DXF, DWG, and DGN formats. Furthermore, specific to DXF, DWG, Wired models, Basic view cube positions, and 3D Faces are also supported. The Surfaces and Meshes supported has been provided for DXF and DGN file formats.
Get Image properties
The API provides you the capabilities to read the properties associated with AutoCAD file formats. The GetImageProperties method provides the feature to read the image properties. The sample image can be found over ENFRIADOR.dwg.
cURL command
In order to use the API, you need to first get JWT access token based on your unique clientID and clientSecret. The following command shows how to obtain a JWT token and then use the same token to perform an operation to read image properties.
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d 'grant_type=client_credentials&client_id=xxxxx-4ea4-a948-3857547232fa&client_secret=xxxxxxx' \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
curl -v "https://api.aspose.cloud/v1.1/cad/ENFRIADOR.dwg/properties" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <JWT Token>"
Request URL
https://api.aspose.cloud:443/v1.1/cad/ENFRIADOR.dwg/properties?appsid=3b769b8d-1c8e-4ea4-a948-3857547232fa&signature=u9Zk85N8HbUJNdVHjHySADt8jVw
Request Body
{
"DefaultFont": null,
"SpecifiedEncoding": "Default",
"MaxPoint": "(6090.28; -13458.42; 0)",
"MinPoint": "(5459.77; -13904.82; 0)",
"AcadVersion": "AC1015",
"Height": "446",
"Width": "630",
"Code": 200,
"Status": "OK"
}
Resize AutoCAD images
Resizing or scaling is one of the common activities when dealing with images. The Aspose.CAD Cloud is capable of providing features to get the scale factor of an existing image using GetChangeImageScale method or you may try using PostChangeImageScale method to change the scale of an image loaded from local system storage and provided in the request body. Please note that during image resize operation, you also need to provide the output format from the following list (BMP, PNG, JPG, JPEG, JPEG2000, TIF, TIFF, PSD, GIF, PDF, WMF).
cURL command
curl -v "https://api.aspose.cloud/v1.1/cad/ENFRIADOR.dwg/resize?format=png&newWidth=200&newHeight=200" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer <JWT Token>" \
-o resultant.png
C#.NET
Resource files
- Input drawing image = ENFRIADOR.dwg
- Resultant output image = Resultant.png
Rotate and Flip CAD drawings
The REST APIs provide an amazing feature to rotate or flip AutoCAD files without using AutoCAD or any other software, and all these operations can be performed using Cloud-based REST APIs. No software download required.
The drawing rotates operation can either be performed on files already available on cloud storage or, you may provide a file from local storage and perform the desired operations. In order to accomplish this requirement, you may directly try accessing REST APIs using cURL commands over command prompt/terminal or, you may try using any of or language-specific Cloud SDKs. Specified below are examples to fulfill the requirements using the cURL command and Aspose.CAD Cloud SDK for .NET. Supported rotate and flip methods are given below.
Rotate180FlipNone, Rotate180FlipX, Rotate180FlipXY, Rotate180FlipY, Rotate270FlipNone, Rotate270FlipX, Rotate270FlipXY, Rotate270FlipY, Rotate90FlipNone, Rotate90FlipX, Rotate90FlipXY, Rotate90FlipY, RotateNoneFlipNone, RotateNoneFlipX, RotateNoneFlipXY, RotateNoneFlipY.
cURL command
curl -v "https://api.aspose.cloud/v1.1/cad/Nikon_D90_Camera.dgn/rotateflip?format=JPEG&method=Rotate90FlipXY" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer <JWT Token>" \
-o Resultant.jpeg
C#.NET
Resources
- Input AutoCAD file = Nikon_D90_Camera.dgn
- Resultant file = Resultant.jpeg
Related Articles
We highly recommend visiting the following links to learn more about: