Setting RAL colors
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Setting RAL colors

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Patrick EMIN
Guest





Posted: Fri Apr 01, 2005 10:03 am    Post subject: Setting RAL colors Reply with quote

Hi,

There is an example in AutoCAD help for assigning color book colors to
objects:

Sub Example_SetNames()
'This example draws a circle and
'returns the color name and color book name of the color.

Dim col As New AcadAcCmColor
Call col.SetRGB(125, 175, 235)
Call col.SetNames("MyColor", "MyColorBook")

Dim cir As AcadCircle
Dim pt(0 To 2) As Double
Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
cir.TrueColor = col
ZoomAll

Dim retCol As AcadAcCmColor
Set retCol = cir.TrueColor
MsgBox "BookName=" & col.BookName
MsgBox "ColorName=" & col.ColorName
End Sub


Why is there two lines:

Call col.SetRGB(125, 175, 235)
Call col.SetNames("MyColor", "MyColorBook")

I need to set a RAL color to an object, do I need to use the RGB syntax,
is the second line of code not enough to give an object a particular color?

Thanks.

--
/////
(o)-(o)
-----ooO---(_)---Ooo--------------------------
Patrick EMIN www.CADxp.com
Le portail francophone CAO et Nouvelles Technologies

Back to top
Ravi Pothineni
Guest





Posted: Mon Apr 04, 2005 10:15 pm    Post subject: Re: Setting RAL colors Reply with quote

The second line of code is enough
Sub test()
Dim col As New AutoCAD.AcadAcCmColor
col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
End Sub

"Patrick EMIN" <pemin@flowline.fr> wrote in message
news:424d0292$1_3@newsprd01...
Quote:
Hi,

There is an example in AutoCAD help for assigning color book colors to
objects:

Sub Example_SetNames()
'This example draws a circle and
'returns the color name and color book name of the color.

Dim col As New AcadAcCmColor
Call col.SetRGB(125, 175, 235)
Call col.SetNames("MyColor", "MyColorBook")

Dim cir As AcadCircle
Dim pt(0 To 2) As Double
Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
cir.TrueColor = col
ZoomAll

Dim retCol As AcadAcCmColor
Set retCol = cir.TrueColor
MsgBox "BookName=" & col.BookName
MsgBox "ColorName=" & col.ColorName
End Sub


Why is there two lines:

Call col.SetRGB(125, 175, 235)
Call col.SetNames("MyColor", "MyColorBook")

I need to set a RAL color to an object, do I need to use the RGB syntax,
is the second line of code not enough to give an object a particular
color?

Thanks.

--
/////
(o)-(o)
-----ooO---(_)---Ooo--------------------------
Patrick EMIN www.CADxp.com
Le portail francophone CAO et Nouvelles Technologies
Back to top
Patrick EMIN
Guest





Posted: Thu Apr 07, 2005 12:03 am    Post subject: Re: Setting RAL colors Reply with quote

Ravi Pothineni a écrit :
Quote:
The second line of code is enough
Sub test()
Dim col As New AutoCAD.AcadAcCmColor
col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
End Sub

Thanks, I'll try that out.
--
/////
(o)-(o)
-----ooO---(_)---Ooo--------------------------
Patrick EMIN www.CADxp.com
Le portail francophone CAO et Nouvelles Technologies

Back to top
Patrick EMIN
Guest





Posted: Thu Apr 07, 2005 11:53 pm    Post subject: Re: Setting RAL colors Reply with quote

Patrick EMIN a écrit :
Quote:
Ravi Pothineni a écrit :

The second line of code is enough
Sub test()
Dim col As New AutoCAD.AcadAcCmColor
col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
End Sub


Thanks, I'll try that out.

It works but it's very, very slow... I guess it's reading the color book
from the hard disk XML file?
I resolved to build a table with the RAL colde and the RGB values instead.
--
/////
(o)-(o)
-----ooO---(_)---Ooo--------------------------
Patrick EMIN www.CADxp.com
Le portail francophone CAO et Nouvelles Technologies
Back to top
Ravi Pothineni
Guest





Posted: Sat Apr 09, 2005 2:31 am    Post subject: Re: Setting RAL colors Reply with quote

It should be slow only the first time the color book is accessed (i.e. the
XML file is loaded from disk). Any subsequent access to the colorbook in
that session of AutoCAD should be instantanous.

"Patrick EMIN" <webmaster@cadxp.com> wrote in message
news:42558fdb$1_1@newsprd01...
Patrick EMIN a écrit :
Quote:
Ravi Pothineni a écrit :

The second line of code is enough
Sub test()
Dim col As New AutoCAD.AcadAcCmColor
col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
End Sub


Thanks, I'll try that out.

It works but it's very, very slow... I guess it's reading the color book
from the hard disk XML file?
I resolved to build a table with the RAL colde and the RGB values instead.
--
/////
(o)-(o)
-----ooO---(_)---Ooo--------------------------
Patrick EMIN www.CADxp.com
Le portail francophone CAO et Nouvelles Technologies
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB