Sam Jones Posted September 10, 2022 Share Posted September 10, 2022 How would someone get the current document text size setting? CurrSize := GetPrefReal(57); Yields a very large value that makes no sense to me. I tried the "Waldo" technique of trying to create a text object and using GetText() but I could not get a handle to use for GetText. So... ? Quote Link to comment
Vectorworks, Inc Employee Julian_Carr Posted September 11, 2022 Vectorworks, Inc Employee Share Posted September 11, 2022 maybe try GetDefaultTextSize()? Note that this is not a document setting. Quote Link to comment
Sam Jones Posted September 11, 2022 Author Share Posted September 11, 2022 Thanks Julian, I need to get the active text size at the start of when a plug-in is run so that I can return it to that size at the end of plug-in execution. I'm pretty sure this would be a document setting, but I'm not positive. Quote Link to comment
MullinRJ Posted September 11, 2022 Share Posted September 11, 2022 Sam, The number you're getting is correct, you just have to change the units — from mm to points, AND correct for the layer scale. I thought everybody knew this. 😜 Try: LyrScale := GetLScale(GetLayer(PIO_Hand)); PtSize := GetPrefReal(57)/LyrScale*72/25.4; { convert doc text size from mm to points } Raymond 1 Quote Link to comment
JBenghiat Posted September 12, 2022 Share Posted September 12, 2022 You can also just use SetTextSize() after you create the text block, and not worry about the document settings. 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.