Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Can you tell whats wrong with this autocad LISP?

Private Sub CommandButton1_Click()

Dim layobj As AcadLayer

Dim lname As String

Dim i As Integer

Dim entObj As Object

Dim test As String

Dim tot As Integer

Dim chl As ChartObject

On Error Resume Next

ListBox1.Clear

For 1 = 0 To ThisDrawing.Layers.Count = 1

Set layobj = ThisDrawing.Layers.Item(1)

lname = layobj.Name

ListBox1.AddItem lname

Next i

userform1.Hide

Err.Clear

Set excelApp = CreateObject("Excel.Application")

If Err <> 0 Then

NsgBox "Could not start Excel", vbExclamation

End

Else

excelApp.Visible -True

Set ubkObj = excelApp.Uorkbooks.Add

Set shtObj = excelApp.Uorksheets(1)

shtObj.cells(1, 1) = "Layer Name"

shtObj.cells(1, 2) = "Legend ƒƒ"

shtObj.cells(1, 3) = "Entities Found"

For i = 0 To ListBox1.ListCount - 1

tot -0

test = ListBox1.List [i]

For 0 = 0 to ThisDrawing.ModelSpace.Count -1

Set entObj = ThisDrawing.ModelSpace,Item(0)

lname -entObj.Layer

If lname - test Then tot -tot + 1

Next j

shtObj.cells(i + 2, 1) = test

shtObj.cells(i + 2, 2) = Str$(1 + 1)

shtObj.cells(i + 2, 3) = tot

Next i

End If

' Find last column entry

i = i

test = shtObj.cells(i, i)

Do While test <> ""

i -i + 1: test -shtObj - cells(i, 1)

Loop

test - "C2:C" £ Trim$ [Str$ (i - i)]

Set chl = Sheets ("Sheetl") . ChartObjects.Add(150, 20, 200, 200]

chl.Chart.ChartWizard Source:"'Worksheets ["Sheetl"] .Range[test],_

Gallery:"'xlPie, Format: -G

Userformal.Shov

End Sub

3 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    I have written hundreds of lisp routines, but this looks like visual basic or something. If you told me the purpose of the routine, I may be able to come up with a solution in autolisp. Chances are that I may have already written something similar.

  • Anonymous
    5 years ago

    Oh, I do that allll the time!! When I'm alone.. I think it's just that you have a lot on your mind. If you think there's something wrong with you, that's just perception. Everyone is different, there's no right or wrong.

  • Anonymous
    1 decade ago

    thats deffinitely vba, what's it supposed to do and what happens when you try to use it?

    I'm guessing you are trying to get some info from autocad to excel?

    If so, they have some pretty good tutorials that you might want to look at.

    http://usa.autodesk.com/adsk/servlet/item?siteID=1...

Still have questions? Get your answers by asking now.