CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 5430 

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 www.cadstudio.cz/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    1458×  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
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.
Tip 10972:Replace text fields with static texts.
Tip 10958:Extended TCase supports accented characters and small caps.


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   



Featuring:
Use Google Earth images in your AutoCAD projects with the Plex.Earth Tools 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.
TOPlist