Print Page | Close Window

point colour import

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=5183
Printed Date: 14.May.2025 at 23:18


Topic: point colour import
Posted By: olyo
Subject: point colour import
Date Posted: 25.Jan.2011 at 09:44
Hello everybody!
I need helpStar
Is there a way to import colour along with point coordinates? For example, I have points defined in .txt format in three columns, after which I have three columns that contain RGB colour components:
 
              X                  Y                    Z                  R                   G                   B
           100                200               300                51                 153                204
 
So I would like to import this point in this colour into AutoCAD.
Is there a way to do that?
 
 



Replies:
Posted By: CarlB
Date Posted: 26.Jan.2011 at 09:53
You'd have to use a script or some code (lisp, etc.)
 
For example a lisp routine could read the file, one line at a time. the first 3 items in a line would be combined to for a 3d point. The next 3 values combined to form "r,g,b".
The coordinate would be fed to a "point" command.then "change" or "chprop" command, "color" then the RGB value.
Repeat for each line in the text file.
 
Script would be tedious. You might first manipulate in Excel to combine the values.
 
A script file would look like;
point
x1,y1,z1
change
l
p
c
r1,g1,b1
 
point
x2,y2,z2
etc...on and on for all points


Posted By: olyo
Date Posted: 26.Jan.2011 at 15:57
Hello!
Thank you very much for replaying so fast. I don't know how to use lisps so I tried to form a script file and I did it and my points got their color Smile
Thank you again.


Posted By: HAWDesigner
Date Posted: 26.Jan.2011 at 20:31
olyo, could you provide a sample of the script for us?

Thanks!!


-------------
--
R. Williams
AutoCAD 2010 Certified Professional
<!-- If all else fails hit F1 -->
<<AutoCAD 2009


Posted By: olyo
Date Posted: 27.Jan.2011 at 08:11
Hi!
I used excel to form script;
CONCATENATE(point;" ";X;",";Y;",";Z;" ";chprop;" ";p;" ";" ";color;" ";t;" ";R;",";G;",";B)
And in scr file it looked like this
point X,Y,Z chprop p  color t R,G,B
 
And that's it Big%20smile 
 
 



Print Page | Close Window