May be you are forgeting to put the vla- to recognize the VBA ActiveX
function
You will find the sintaxis under METHODS of ActiveX and VBA Reference
This is the VBA sintaxis : RetVal =
object.AddLightWeightPolyline(VerticesList)
so you have to do :
(setq ptlist (list pt1 pt2 .....))
(setq plist (apply 'append (mapcar '3dpoint->2dpoint ptlist))
(setq plpoints (List->VariantArray plist));You have now the points ready to
pass to the vla-function
(setq obj (vla-AddLightWeightPolyline
(vla-get-Modelspace (vla-get-ActiveDocument
(vlax-get-acad-object)))
; the line above is the MSPACE or PSPACE collection (object pointer)
plpoints; list of vertices
)
Then you can use vla-Put-..... to set any PROPERTY of the object (look for
the sintaxis under PROPERTIES of ActiveX and VBA Reference) ,
for example
(vla-Put-Closed obj :vlax-True)
If you change any property do not forget to update the object
(vla-Update obj)
and then to release the object and finish , do
(vlax-Release-Object obj)
Hope this helps you
escribió en el mensaje news:5836989@discussion.autodesk.com...
While doing the Tutorial in AutoCAD I ran across the following error:
"error: ActiveX Server returned the error: unknown name:
AddLightWeightPolyline"
I have loaded the ActiveX components (I think) with (vl-load-com). I also
successful ran other vla- commands, before this one, in the same project.
I am still a newbie with ActiveX; but I am guessing it is because
AddLightWeightPolyline, might not be in my ActiveX file; but I can find it
using the Ctrl-Shift-Space lookup of Visual Lisp.
Does anyone know what the above error means and what I might do to fix it?
Thanks.