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

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    3302×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 12701:What is the maximum length of a list in AutoCAD VisualLISP?
Tip 12403:Get center point of a group of selected objects.
Tip 12210:How to erase a specific object type in all DWG layouts?
Tip 11996:How to rotate selected blocks by the angle of an existing block?
Tip 11924:Simple navigation - switching 3D views with your numpad.


Back   All CAD Tips All CAD tips&tricks



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:
Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info


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