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"
)
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Solved by _Tharwat. Go to Solution.
I am not sure about the Autocad veriosn number for 2014 but replace the number 18 to 19 and try again .
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
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
@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