0 Members and 1 Guest are viewing this topic.
So I was looking at maybe studying Common Lisp (clisp) as a .Net language, would that work with AutoCad? I was doing this just because maybe the syntax would be the same as lisp is, so maybe the learning curve won't be as bad.
Quote from: T.Willey on July 14, 2006, 12:12:40 PMSo I was looking at maybe studying Common Lisp (clisp) as a .Net language, would that work with AutoCad? I was doing this just because maybe the syntax would be the same as lisp is, so maybe the learning curve won't be as bad.I suggest you take an hour or two of your time and look into boo. If that doesn't look to bad you can develop AutoCAD apps in it.
Mick, this is the original code postingQuote from: jbuzbee on June 21, 2006, 09:09:15 PMWritten by Tony Tanzillo sometime in the beginning of the 21st Century . . . Code: [Select]Private vlapp As ObjectPrivate vlFuncs As ObjectPublic Function EvalLispExpression(lispStatement As String) Dim sym As Object, RET As Object, retVal Set vlapp = CreateObject("Vl.Application.16") Set vlFuncs = vlapp.ActiveDocument.Functions Set sym = vlFuncs.Item("read").funcall(lispStatement) On Error Resume Next retVal = vlFuncs.Item("eval").funcall(sym) If Err Then EvalLispExpression = "" Else EvalLispExpression = retVal End IfEnd FunctionPublic Sub SetLispVar(Symbol As String, Value)'Dim vlapp As Object'Dim vlFuncs As ObjectDim vlSet As ObjectDim vSymSet vlapp = CreateObject("Vl.Application.16")Set vlFuncs = vlapp.ActiveDocument.FunctionsSet vSym = vlFuncs.Item("read").funcall(Symbol)Set vlSet = vlFuncs.Item("set")Select Case VarType(Value)Case vbByte, vbInteger, vbLongDim lVal As LonglVal = ValuevlSet.funcall vSym, lValCase vbStringDim strVal As StringstrVal = ValuevlSet.funcall vSym, strValCase vbDoubleDim dblVal As StringdblVal = ValuevlSet.funcall vSym, dblValCase vbEmptyvlSet.funcall vSym, vlFuncs.Item("read").funcall("nil")Case ElseIf IsArray(Value) ThenDim List As VariantList = ValuevlSet.funcall vSym, ListElsevlSet.funcall vSym, ValueEnd IfEnd SelectEnd SubPublic Function GetLispVar(Symbol As String) As Variant'Dim vlapp As Object'Dim vlFuncs As ObjectSet vlapp = CreateObject("Vl.Application.16")Set vlFuncs = vlapp.ActiveDocument.FunctionsGetLispVar = vlFuncs.Item("eval").funcall(vlFuncs.Item("read").funcall(Symbol))End FunctionHere are some example uses:Code: [Select]If index1 > -1 Thenws = ListBox1.List(ListBox1.ListIndex)End IfIf index2 > -1 Thendwg = ListBox2.List(ListBox2.ListIndex)End IfSetLispVar "jb%WorkingState", wsSetLispVar "jb%WSXref", dwg
Written by Tony Tanzillo sometime in the beginning of the 21st Century . . . Code: [Select]Private vlapp As ObjectPrivate vlFuncs As ObjectPublic Function EvalLispExpression(lispStatement As String) Dim sym As Object, RET As Object, retVal Set vlapp = CreateObject("Vl.Application.16") Set vlFuncs = vlapp.ActiveDocument.Functions Set sym = vlFuncs.Item("read").funcall(lispStatement) On Error Resume Next retVal = vlFuncs.Item("eval").funcall(sym) If Err Then EvalLispExpression = "" Else EvalLispExpression = retVal End IfEnd FunctionPublic Sub SetLispVar(Symbol As String, Value)'Dim vlapp As Object'Dim vlFuncs As ObjectDim vlSet As ObjectDim vSymSet vlapp = CreateObject("Vl.Application.16")Set vlFuncs = vlapp.ActiveDocument.FunctionsSet vSym = vlFuncs.Item("read").funcall(Symbol)Set vlSet = vlFuncs.Item("set")Select Case VarType(Value)Case vbByte, vbInteger, vbLongDim lVal As LonglVal = ValuevlSet.funcall vSym, lValCase vbStringDim strVal As StringstrVal = ValuevlSet.funcall vSym, strValCase vbDoubleDim dblVal As StringdblVal = ValuevlSet.funcall vSym, dblValCase vbEmptyvlSet.funcall vSym, vlFuncs.Item("read").funcall("nil")Case ElseIf IsArray(Value) ThenDim List As VariantList = ValuevlSet.funcall vSym, ListElsevlSet.funcall vSym, ValueEnd IfEnd SelectEnd SubPublic Function GetLispVar(Symbol As String) As Variant'Dim vlapp As Object'Dim vlFuncs As ObjectSet vlapp = CreateObject("Vl.Application.16")Set vlFuncs = vlapp.ActiveDocument.FunctionsGetLispVar = vlFuncs.Item("eval").funcall(vlFuncs.Item("read").funcall(Symbol))End FunctionHere are some example uses:Code: [Select]If index1 > -1 Thenws = ListBox1.List(ListBox1.ListIndex)End IfIf index2 > -1 Thendwg = ListBox2.List(ListBox2.ListIndex)End IfSetLispVar "jb%WorkingState", wsSetLispVar "jb%WSXref", dwg
Private vlapp As ObjectPrivate vlFuncs As ObjectPublic Function EvalLispExpression(lispStatement As String) Dim sym As Object, RET As Object, retVal Set vlapp = CreateObject("Vl.Application.16") Set vlFuncs = vlapp.ActiveDocument.Functions Set sym = vlFuncs.Item("read").funcall(lispStatement) On Error Resume Next retVal = vlFuncs.Item("eval").funcall(sym) If Err Then EvalLispExpression = "" Else EvalLispExpression = retVal End IfEnd FunctionPublic Sub SetLispVar(Symbol As String, Value)'Dim vlapp As Object'Dim vlFuncs As ObjectDim vlSet As ObjectDim vSymSet vlapp = CreateObject("Vl.Application.16")Set vlFuncs = vlapp.ActiveDocument.FunctionsSet vSym = vlFuncs.Item("read").funcall(Symbol)Set vlSet = vlFuncs.Item("set")Select Case VarType(Value)Case vbByte, vbInteger, vbLongDim lVal As LonglVal = ValuevlSet.funcall vSym, lValCase vbStringDim strVal As StringstrVal = ValuevlSet.funcall vSym, strValCase vbDoubleDim dblVal As StringdblVal = ValuevlSet.funcall vSym, dblValCase vbEmptyvlSet.funcall vSym, vlFuncs.Item("read").funcall("nil")Case ElseIf IsArray(Value) ThenDim List As VariantList = ValuevlSet.funcall vSym, ListElsevlSet.funcall vSym, ValueEnd IfEnd SelectEnd SubPublic Function GetLispVar(Symbol As String) As Variant'Dim vlapp As Object'Dim vlFuncs As ObjectSet vlapp = CreateObject("Vl.Application.16")Set vlFuncs = vlapp.ActiveDocument.FunctionsGetLispVar = vlFuncs.Item("eval").funcall(vlFuncs.Item("read").funcall(Symbol))End Function
If index1 > -1 Thenws = ListBox1.List(ListBox1.ListIndex)End IfIf index2 > -1 Thendwg = ListBox2.List(ListBox2.ListIndex)End IfSetLispVar "jb%WorkingState", wsSetLispVar "jb%WSXref", dwg