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: 3649

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

See also:
Tip 13038:How to explode 3D faces (3DFACE) into outline polyline?
Tip 12766:Lines with a single grip, incorrect osnaps, intersections, offsets, hatches - CheckLarge
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?


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