Gal Posted April 26, 2022 Share Posted April 26, 2022 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, 2022 Share Posted April 26, 2022 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, 2022 Author Share Posted April 26, 2022 Thank you Peter! That is Amazing! Quote Link to comment
Gal Posted May 10, 2022 Author Share Posted May 10, 2022 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, 2022 Share Posted May 11, 2022 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, 2022 Share Posted May 31, 2022 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.