Print Page | Close Window

Script file for colored solid square

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=13491
Printed Date: 05.Sep.2026 at 10:36


Topic: Script file for colored solid square
Posted By: cem35
Subject: Script file for colored solid square
Date Posted: 02.Sep.2020 at 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



Replies:
Posted By: Vladimir Michl
Date Posted: 04.Sep.2020 at 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.



-------------
Vladimir Michl (moderator)
https://www.linkedin.com/in/vmichl/" rel="nofollow - LinkedIn , Autodesk Expert Elite


Posted By: rebellio
Date Posted: 04.Sep.2020 at 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.....
Regards
uploads/39979/solid_rectangles.lsp" rel="nofollow - uploads/39979/solid_rectangles.lsp


Posted By: cem35
Date Posted: 09.Sep.2020 at 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


Posted By: rebellio
Date Posted: 18.Sep.2020 at 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


Posted By: Kent Cooper
Date Posted: 29.Sep.2020 at 20:14
Originally posted by cem35 cem35 wrote:

... I have 9000 number of  coordinates to apply it. 
same square size  but different color

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.)



Print Page | Close Window