ilovehuizi 发表于 2004-9-29 11:58:00

斑竹看看这个链接为何不能用了?VLAX类

斑竹大人 ,不得不在麻烦你一下。我现在需要 vlax类 ,本站有如下链接


<A href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=9328" target="_blank" >http://bbs.mjtd.com/forum.php?mod=viewthread&tid=9328</A>


但是现在不能下载,斑竹可否重新激活链接,让小弟下载一次。


小弟 先谢了~~

雪山飞狐_lzh 发表于 2004-9-29 12:03:00

看看10楼的发言

ilovehuizi 发表于 2004-9-29 12:41:00

斑竹关键是我现在大不开代码,怎么拷贝呢? 十楼的发言 偶已经看了。


麻烦 多指点~···

雪山飞狐_lzh 发表于 2004-9-29 13:15:00

初级用户是不能看见,:)


' VLAX.CLS v2.0 (Last updated 8/1/2003)<BR>' Copyright 1999-2001 by Frank Oquendo<BR>'<BR>' 该程序由明经通道修改支持2004版本<BR>' <A href="http://www.mjtd.com/" target="_blank" >http://www.mjtd.com</A><BR>'<BR>' Permission to use, copy, modify, and distribute this software<BR>' for any purpose and without fee is hereby granted, provided<BR>' that the above copyright notice appears in all copies and<BR>' that both that copyright notice and the limited warranty and<BR>' restricted rights notice below appear in all supporting<BR>' documentation.<BR>'<BR>' FRANK OQUENDO (THE AUTHOR) PROVIDES THIS PROGRAM "AS IS" AND WITH<BR>' ALL FAULTS. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY<BR>' OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.       THE AUTHOR<BR>' DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE<BR>' UNINTERRUPTED OR ERROR FREE.<BR>'<BR>' Use, duplication, or disclosure by the U.S. Government is subject to<BR>' restrictions set forth in FAR 52.227-19 (Commercial Computer<BR>' Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)<BR>' (Rights in Technical Data and Computer Software), as applicable.<BR>'<BR>' VLAX.cls allows developers to evaluate AutoLISP expressions from<BR>' Visual Basic or VBA<BR>'<BR>' Notes:<BR>' All code for this class module is publicly available througout various posts<BR>' at <A href="news://discussion.autodesk.com/autodesk.autocad.customization.vba" target="_blank" >news://discussion.autodesk.com/autodesk.autocad.customization.vba</A>. I do not<BR>' claim copyright or authorship on code presented in these posts, only on this<BR>' compilation of that code. In addition, a great big "Thank you!" to Cyrille Fauvel<BR>' demonstrating the use of the VisualLISP ActiveX Module.<BR>'<BR>' Dependencies:<BR>' Use of this class module requires the following application:<BR>' 1. VisualLISP


Private VL As Object<BR>Private VLF As Object


Private Sub Class_Initialize()


                       If Left(ThisDrawing.Application.Version, 2) = "15" Then<BR>                               Set VL = GetInterfaceObject("VL.Application.1")<BR>                       ElseIf Left(ThisDrawing.Application.Version, 2) = "16" Then<BR>                               Set VL = GetInterfaceObject("VL.Application.16")<BR>                       End If<BR>                       Set VLF = VL.ActiveDocument.Functions<BR>End Sub


Private Sub Class_Terminate()


                       Set VLF = Nothing<BR>                       Set VL = Nothing


End Sub


Public Function EvalLispExpression(ByVal lispStatement As String)


                       Dim sym As Object, ret As Object, retval<BR>                       <BR>                       Set sym = VLF.Item("read").funcall(lispStatement)<BR>                       On Error Resume Next<BR>                       retval = VLF.Item("eval").funcall(sym)<BR>                       If Err Then<BR>                                                       EvalLispExpression = ""<BR>                       Else<BR>                                                       EvalLispExpression = retval<BR>                       End If


End Function


Public Sub SetLispSymbol(ByVal symbolName As String, ByVal Value)


                       Dim sym As Object, ret, symvalue<BR>                       <BR>                       symvalue = Value<BR>                       Set sym = VLF.Item("read").funcall(symbolName)<BR>                       ret = VLF.Item("set").funcall(sym, symvalue)<BR>                       EvalLispExpression "(defun translate-variant (data) (cond ((= (type data) 'list) (mapcar 'translate-variant data)) ((= (type data) 'variant) (translate-variant (vlax-variant-value data))) ((= (type data) 'safearray) (mapcar 'translate-variant (vlax-safearray-&gt;list data))) (t data)))"<BR>                       EvalLispExpression "(setq " &amp; symbolName &amp; "(translate-variant " &amp; symbolName &amp; "))"<BR>                       EvalLispExpression "(setq translate-variant nil)"


End Sub


Public Function GetLispSymbol(ByVal symbolName As String)


                       Dim sym As Object, ret, symvalue<BR>                       <BR>                       symvalue = Value<BR>                       Set sym = VLF.Item("read").funcall(symbolName)<BR>                       GetLispSymbol = VLF.Item("eval").funcall(sym)


End Function


Public Function GetLispList(ByVal symbolName As String) As Variant


               Dim sym As Object, list As Object<BR>               Dim Count, elements(), i As Long<BR>               <BR>               Set sym = VLF.Item("read").funcall(symbolName)<BR>               Set list = VLF.Item("eval").funcall(sym)<BR>               <BR>               Count = VLF.Item("length").funcall(list)<BR>               <BR>               ReDim elements(0 To Count - 1) As Variant<BR>               <BR>               For i = 0 To Count - 1<BR>                                                       elements(i) = VLF.Item("nth").funcall(i, list)<BR>               Next<BR>               <BR>               GetLispList = elements<BR>               <BR>End Function


Public Sub NullifySymbol(ParamArray symbolName())


                       Dim i As Integer<BR>                       <BR>                       For i = LBound(symbolName) To UBound(symbolName)<BR>                                                       EvalLispExpression "(setq " &amp; CStr(symbolName(i)) &amp; " nil)"<BR>                       Next


End Sub<BR>

ilovehuizi 发表于 2004-9-29 15:06:00

多谢斑竹~~ 斑竹节日快乐!

NetBee 发表于 2007-3-15 21:57:00

好东东,最近准备用VBA了
页: [1]
查看完整版本: 斑竹看看这个链接为何不能用了?VLAX类