Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get to the colors in AutoCAD 2014

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
vladislav.babich
810 Views, 8 Replies

How to get to the colors in AutoCAD 2014

I am trying to access the colors in LISP 2014. Scrip worked fine in AutoCAD 2012. Anybody knows what is wrong now?

(vla-GetInterfaceObject

(vlax-get-acad-object)

"AutoCAD.AcCmColor.18"

)

 

Keep praying.
8 REPLIES 8
Message 2 of 9
_Tharwat
in reply to: vladislav.babich

I am not sure about the Autocad veriosn number for 2014 but replace the number 18 to 19 and try again .

Message 3 of 9
hmsilva
in reply to: vladislav.babich

Vladislav,

in addition to what Tharwat said, perhaps something like this can be used in more versions...

 

(vla-GetInterfaceObject
  (vlax-get-acad-object)
  (strcat "AutoCAD.AcCmColor." (substr (getvar 'ACADVER) 1 2))
)

 

HTH

Henrique

EESignature

Message 4 of 9
dicra
in reply to: vladislav.babich

Hi Vladislav,

 

I don't know a lot about vla-GetInterfaceObject, but maybe you could try with:

(vlax-Get-or-create-object

"AutoCAD.AcCmColor.18"
)

 

It returns the same thing in autocad 2012

Message 5 of 9
vladislav.babich
in reply to: _Tharwat

Thanks _Tharwat :o)
Keep praying.
Message 6 of 9
vladislav.babich
in reply to: hmsilva

Hi hmsilva,
Nice! I was thinking in the same direction. Too lasy to change my script every time I got new AutoCAD 🙂
Br, Vlad
Keep praying.
Message 7 of 9
_Tharwat
in reply to: vladislav.babich


@vladislav.babich wrote:
Thanks _Tharwat :o)

You're welcome .

 

Message 8 of 9
hmsilva
in reply to: vladislav.babich


@vladislav.babich wrote:
Hi hmsilva,
Nice! I was thinking in the same direction. Too lasy to change my script every time I got new AutoCAD 🙂
Br, Vlad

You can also use something like this

(itoa (atoi (getvar "acadver")))

 

Cheers

Henrique

EESignature

Message 9 of 9
Lee_Mac
in reply to: hmsilva

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost