Gal Posted April 26 Share Posted April 26 Hello everyone! Importing a RTL text from AutoCAD seems to be very tricky. The best solution will be a script that will reverse selected text. However I have no coding abilities whatsoever. Will anyone be able to help me here? 🙏 Gal 1 Quote Link to comment
Peter Vandewalle Posted April 26 Share Posted April 26 In Python that'll be easier: hText = vs.LSActLayer() sText = vs.GetText(hText) sTextReverse = sText[::-1] vs.SetText(hText, sTextReverse) Quote Link to comment
Gal Posted April 26 Author Share Posted April 26 Thank you Peter! That is Amazing! Quote Link to comment
Gal Posted May 10 Author Share Posted May 10 Hi Peter, Is there a way to make the script work when multiple text objects are selected? 🙏 Gal Quote Link to comment
Peter Vandewalle Posted May 11 Share Posted May 11 Sure: def reverse_it(hObj): sText = vs.GetText(hObj) sTextReverse = sText[::-1] vs.SetText(hObj, sTextReverse) vs.ForEachObject(reverse_it, "(NOTINDLVP & NOTINREFDLVP & ((T=TEXT) & (VSEL=TRUE)))") 1 1 Quote Link to comment
lilah Posted May 31 Share Posted May 31 Thanks a lot, it works great. Is it possible to perform a similar inversion within a worksheet? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.