CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 6989

CAD tip CAD tip # 10955:

   
Question CAD 
 %  platform  category 
Q - question

Evaluate VBScript functions from AutoLISP.

A - answer Sometimes you may prefer to use a VBScript function over AutoLISP as it would be easier, faster or more convenient than the native LISP (VisualLISP) program code.

The evalVBS function is a wrapper for these situations. You can use it to quickly run any VBScript code from inside your LISP routines. Download the evalVBS.LSP source code by CAD Studio from Download, load it and call it with (evalVBS "myVBScodeString").

;examples (use 'result' for any return value):
;(evalVBS "MsgBox(\"Hello world!\")")
;(setq mystring2 (evalVBS (strcat "result = LCase(\"" mystring1 "\")")))
;(evalVBS "MsgBox(\"VBcommand 1\") : MsgBox(\"VBcommand 2\")")
;(evalVBS "MsgBox(\"VBcommand 1\")\nMsgBox(\"VBcommand 2\")")
;
;return values:
;"" = no value returned
;nil = failed
;"1.xxxx" = return value as a string
ACAD
100% *  CAD 
12.6.2016    11306×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 14061:Animated drawing of geometry in AutoCAD.
Tip 13878:SelectSimilar - extended selections for AutoCAD, incl. LT and Web versions
Tip 13749:How to add the SEARCH/REPLACE command into AutoCAD Web?
Tip 13737:Formatting leading zeros in AutoCAD fields (and automatic field update).
Tip 13683:Limitations of the LISP language (AutoLISP, VisualLISP) in AutoCAD LT - what to watch out for


Back   All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Save your floating licenses (NLS) consumed by inactive users - free unused licenses with
LogOff 2006 More info


Please use these tips at your own risk.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist