([color=BLUE]defun[/color] c:FindStacked [color=GREEN];; Find Stacked - Lee Mac 2011 - www.lee-mac.com[/color] ( [color=BLUE]/[/color] *error* _prompt _replace _dissect _textstring ent inc new old rgx sel str ) ([color=BLUE]defun[/color] *error* ( msg ) ([color=BLUE]if[/color] ([color=BLUE]and[/color] rgx ([color=BLUE]not[/color] ([color=BLUE]vlax-object-released-p[/color] rgx))) ([color=BLUE]vlax-release-object[/color] rgx)) ([color=BLUE]if[/color] ([color=BLUE]not[/color] ([color=BLUE]wcmatch[/color] ([color=BLUE]strcase[/color] msg) [color=MAROON]"*BREAK,*CANCEL*,*EXIT*"[/color])) ([color=BLUE]princ[/color] ([color=BLUE]strcat[/color] [color=MAROON]"\nError: "[/color] msg)) ) ([color=BLUE]princ[/color]) ) ([color=BLUE]defun[/color] _prompt ( msg [color=BLUE]/[/color] var ) ([color=BLUE]while[/color] ([color=BLUE]not[/color] ([color=BLUE]vl-string-position[/color] 47 ([color=BLUE]setq[/color] var ([color=BLUE]getstring[/color] msg)))) ([color=BLUE]princ[/color] [color=MAROON]"\nPlease Enter a Fractional String."[/color]) ) ([color=BLUE]if[/color] ([color=BLUE]vla-object[/color] ent) str) ) ) ([color=BLUE]vlax-release-object[/color] rgx) ) ) ([color=BLUE]princ[/color]))
I have retained simplicity in the above code for clarity and consequently it is by no means bullet-proof. For a full application, I would include code to account for literal occurrences of "\\S" in the MText string, and occurrences of "/" amongst other characters in the numerator and denominator of the fraction; but above all, the code demonstrates the method I would follow.
Definitely no. There won't be any ActiveX over there so the vlax-get-or-create-object would already fail. Never mind that there also isn't anything like VBScript.RegExp to play with.
Edit: Painful ain't it? Another reason I'd like to see a Common Lisp interpreter inside AutoCAD: http://www.cliki.net/regular%20expression
Well, "at present" yes.
If you glance at the video tutorial for making stuff in OSX: http://wikihelp.autodesk.com/AutoCAD_for_Mac/enu/2011/Help/Developer_Documentation/Migrating_Windows_Applications/ObjectARX_-_Mac_OS_X_Migration_Guide/Required_Development_Tools
You'll note they "glance over" the fact that none of DotNet works anywhere else than in Windows! Though they mention something about "AutoDesk is working on resolving this". I just wonder how long they've been "working" on it? And if there's any sort of progress. I know the biggest reason behind most programs not running in Linux through WINE is due to DotNet requirements, and WINE has been going at it for some years already. So I'm not holding my breath on the DotNet in OSX score!