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

Help with ActiveX

1 REPLY 1
Reply
Message 1 of 2
hanchris
236 Views, 1 Reply

Help with ActiveX

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.
1 REPLY 1
Message 2 of 2
Anonymous
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.

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

Post to forums  

Autodesk Design & Make Report

”Boost