Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
hanchris
Posts: 308
Registered: ‎10-24-2007
Message 1 of 2 (97 Views)

Help with ActiveX

97 Views, 1 Replies
02-01-2008 10:23 AM
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.
*Gustavo_Guidi
Message 2 of 2 (97 Views)

Re: Help with ActiveX

02-01-2008 11:56 AM in reply to: hanchris
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.
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.