0

I would like to change TrueColor property of a line object in AutoCAD 2013 using VBA.

I used the code which I found in Developer's guide, but it won't work.

The code is:

Dim VozniCrtaDesna As AcadLine
Set VozniCrtaDesna = ThisDrawing.ModelSpace.AddLine(Zero, KoncnaDesnaTocka)

Dim color As AcadAcCmColor
Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
Call color.SetRGB(80, 100, 244)
VozniCrtaDesna.TrueColor = color

VozniCrtaDesna.Update

It throws an error:

Run-time error: '-2147221005 (800401f3)':
Problem in loading application

Any ideas what the problem would be?

Thanks. Špela

Owen Wengerd
  • 1,628
  • 1
  • 11
  • 11
Liz
  • 363
  • 3
  • 12
  • Which version of AutoCAD are you using? The code you posted appears to be for AutoCAD 2004/2005/2006. – Owen Wengerd Feb 15 '14 at 04:57
  • I am using AutoCAD 2013 but AutoCAD 2006 VBA Programmer's reference by Joe Suthpin. So far everything worked, but this obviusly doesn't... If anyone knows any VBA documentation for a newer version of AutoCAD I would very much appreciate it. – Liz Feb 20 '14 at 12:25
  • Post your VBA documentation questions on one of the AutoCAD VBA discussion forums where someone can offer suggestions. At the very least, you should be using the VBA reference for AutoCAD 2013. – Owen Wengerd Feb 20 '14 at 14:53

1 Answers1

0

For AutoCAD 2013/2014, you need to use "AutoCAD.AcCmColor.19".

Owen Wengerd
  • 1,628
  • 1
  • 11
  • 11