VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Running Autolisp command from VBA does not work!!

0 REPLIES 0
Reply
Message 1 of 1
leoroncetti
378 Views, 0 Replies

Running Autolisp command from VBA does not work!!

I have a lisp routine to count blocks and it works just fine. I load it and type "countblock" or "(c:countblock)".

 

I want to run it in VBA (2010) but the code does not work. What am I missing?

 

Public Sub DrawToScreen2()
Dim strGRVECS As String
Dim objVL As Object
Dim objVLF As Object
Dim objVLO As Object
Dim varReturned As Variant
Set objVL = ThisDrawing.Application.GetInterfaceObject("VL.Application.16")
Set objVLF = objVL.ActiveDocument.Functions
Set objVLO = objVLF.Item("read").funcall("(C:BlockCount)")
varReturned = objVLF.Item("eval").funcall(objVLO)       '' *** this line returns an error (13) type mismatch....
End Sub

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report

”Boost