Display full version of the post: Script file for colored solid square

cem35
02.09.2020, 21:23
Hi,  I need some help.  Iam using AutoCAD2021, I want to plot a square and filled by a color to a specific coordinate of x and y using a script file (.scr).my input is x,y, a (one side), filled by a color, let us say red,blue ... whichever I want. How can I do it by sorting Script file  in autoCAd. Thanks
cem352020-09-02 21:24:31

Vladimir Michl
04.09.2020, 09:01
You can either use the SOLID command to draw filled squares. Or just draw the RECTANGLE and then use HATCH Last to fill it.

rebellio
04.09.2020, 12:58
Something Like This?It is in lisp, load the lisp via appload command and type RSH and type coordinates or pick 2 points.....Regardsuploads/39979/solid_rectangles.lsprebellio2020-09-04 16:22:35

cem35
09.09.2020, 12:47
Thank you for answer, Could you give an example to be written in .scr flie.Forexample: _RECTANGLE x1,y1 x2,y2...... Because I have 9000 number of  coordinates to apply it. same square size  but different color
cem352020-09-09 12:49:42

rebellio
18.09.2020, 13:41
Hi,Can you explain something more about the purpose of those rectangles?Perhaps you can do a workaround with the array command..... i am afraid that it is not doable in script,Regards

Kent Cooper
29.09.2020, 20:14
[QUOTE=cem35]... I have 9000 number of  coordinates to apply it. same square size  but different color
[/QUOTE]
In what form do you have the 9000 locations?  And the colors to give them?  A spreadsheet file?  A text file of some kind?  Something else?If they are in a file of some kind that AutoLisp can open and read, then an AutoLisp routine could probably do what you need, but as far as I know not a Script.  (Some people use "script" generically, to include things like AutoLisp routines, but the word has a specific, and different, meaning in AutoCAD.)