CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 8389 
Plex.Earth connects AutoCAD and Google Earth

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, 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
100% *  CAD 
12.6.2016    1739×  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
Tip 11780:How to rename layouts by a specific attribute of the title block?
Tip 11729:Select objects by annotation scale.
Tip 11604:How to set plot transparency for all layouts in a DWG?
Tip 11511:Assigning elevations to 2D contours (isolines).
Tip 11171:Total number of layouts as a field.

Back   All CAD Tips All CAD tips&tricks

Extended TCase supports accented characters and small caps. « | » All DWG texts in UPPERCASE.

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   

Track your time spent working on AutoCAD or Revit jobs - automatically with
CADstudio JobTime More info

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.