Export Canvas drawings to Autodesk AutoCAD Program using .scr script file

AutoCAD is a computer-aided design (CAD) program used for 2-D and 3-D design and drafting developed by Autodesk .

This topic is to help anyone looking for a solution to this problem. After searching, I found an easy way to transfer what was drawn on the board to the AutoCAD program without exporting a dwg or dxf file.
Due to the difficulty of exporting these files on app inventor .

My solution is :

  • Recording the coordinates of each element drawn on the canvas and saving it in a list, which can be included in the tinnydb database.

  • Save these coordinates as a text file with the scr extension
    .scr

Script (SCR) files are used to automate repetitive tasks by executing commands and command options in a specific sequence in AutoCAD .

Script files are ASCII text files with the file extension .scr and can be edited using a simple text editor such as NotePad on Windows or TextEdit on Mac OS

Provided that the AutoCAD commands to be drawn are placed before each coordinate or dimensions

Example of a polyline drawing

_Polyline
x1,y1
x2,y2
x3,y3
x4,y4

space or\n to end the command

With this, a series of sequential commands can be created (lines - circles - dimensions... or any drawing command available on AutoCAD).

Orders can be terminated by <return> to end the file orders

Some people may need to make the coordinate sign on the y axis negative ( Y * -1 ) so that the drawings on AutoCAD do not appear upside down, due to the difference in the coordinate signs between Canvas and AutoCAD.

x1,-y1
x2,-y2
x3,-y3
x4,-y4

  • Save the file with scr extension

  • After saving the file from the application, you can drag and drop it into the drawing project in the AutoCAD program to be drawn automatically.


_Zoom Z : Zoom extents command to zoom the Polylines drawn inside the file

https://community.appinventor.mit.edu/t/how-can-i-export-canvas-drawing-as-dxf-file-format-dxf/113451

The link below contains how to create SCR files using Notepad Text _ From Autodesk

https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-BE44AE86-7638-48C9-BE5B-C1DF8E4C8808

1 Like

nice tutorial, but this is not an extension. I changed the catagory.

1 Like

it should be _Polyline? or _PLINE? is it case sensitive?

and what about other command's format?

1 Like

to draw Polyline

Polyline or PL or Pline

to draw line

L or Line

to draw Rectangle

REC or rectangle or rectang

to draw circle

C or Circle

The same commands and shortcuts that are written on the command line within the AutoCAD program

To execute the command, there must be a single space or a new line to exit the command and start a new command. If two adjacent spaces are entered, the command will be repeated again.

In this link there are most of the commands that can be used and their hot keys