用法:_$ (vlax-variant-value (vbStrCat "Hello " "World!"))
"Hello World!"- ;;;************************************************************
- ;;; Filename: vbStringClass.LSP
- ;;; Author: David M. Stein
- ;;; Date: 3/2/02
- ;;; Purpose: Demonstrates use of imported DLL functions within
- ;;; Visual LISP functions
- ;;;************************************************************(vl-load-com)(defun vbStrCat (string1 string2 / acad vbstrcls out)
- (setq acad (vlax-get-acad-object))
- (setq vbstrcls
- (vlax-invoke-method acad
- "getInterfaceObject" "vbStringClass.vbStrings"
- )
- )
- (setq out
- (vlax-invoke-method vbstrcls
- "StrConcat" string1 string2
- )
- )
- (vlax-release-object vbstrcls)
- (vlax-release-object acad)
- out
- )(defun vbStrRev (string / acad vbstrcls out)
- (setq acad (vlax-get-acad-object))
- (setq vbstrcls
- (vlax-invoke-method acad
- "getInterfaceObject" "vbStringClass.vbStrings"
- )
- )
- (setq out
- (vlax-invoke-method vbstrcls
- "StrRev" string
- )
- )
- (vlax-release-object vbstrcls)
- (vlax-release-object acad)
- out
- )(defun vbStrVer ( / acad vbstrcls out)
- (setq acad (vlax-get-acad-object))
- (setq vbstrcls
- (vlax-invoke-method acad
- "getInterfaceObject" "vbStringClass.vbStrings"
- )
- )
- (setq out
- (vlax-invoke-method vbstrcls "StrVer")
- )
- (vlax-release-object vbstrcls)
- (vlax-release-object acad)
- out
- )(defun vbmathadd ( int1 int2 / acad vbstrcls out)
- (setq acad (vlax-get-acad-object))
- (setq vbstrcls
- (vlax-invoke-method acad
- "getInterfaceObject" "vbStringClass.vbStrings"
- )
- )
- (setq out
- (vlax-invoke-method vbstrcls "mathadd" int1 int2)
- )
- (vlax-release-object vbstrcls)
- (vlax-release-object acad)
- out
- )
|