Display full version of the post: point colour import

olyo
25.01.2011, 09:44



Hello everybody!I need helpIs 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?   olyo2011-01-25 10:00:11

CarlB
26.01.2011, 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

olyo
26.01.2011, 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 Thank you again.

HAWDesigner
26.01.2011, 20:31
olyo, could you provide a sample of the script for us?Thanks!!

olyo
27.01.2011, 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