rebu1985 Posted February 27, 2017 Share Posted February 27, 2017 Hi guys, I have created a predefined text style to use in my standard dimensions options. I was checking to change the text style manually and i cant do it because when i try it the text style changes to a new undefined one. I would like to know if its possible to create a script with modify any text style (font, size, etc) by myself. I was checking the function 'SetTextStyle' but i am not sure if its the correct one. For example: I have a text style called dimensions with Arial 8pt and bold and i would like to change by Calibri 10 pt and not font style. Thanks!! Quote Link to comment
Patrick Winkler Posted February 27, 2017 Share Posted February 27, 2017 (edited) SetTextstyle changes the Texts. of an text object in the drawing. I tried to change the textstyle with obj selectors but this had no effect. h = GetObject ('MyTextStyle') kFontIndexSelector = 1360 kFontSizeSel = 1361 times_font_ID = GetFontID('Times New Roman') print (times_font_ID) #SetObjectVariableInt(h, kFontIndexSelector, times_font_ID) SetObjectVariableInt(h, kFontSizeSel, 5.0) What VW Version do you use? Did you change the custom textstyles in the resource browser/manager? Edited February 27, 2017 by Patrick Winkler Quote Link to comment
JBenghiat Posted February 27, 2017 Share Posted February 27, 2017 Just to reiterate the end of the above, are you possibly trying to re-save a text style rather than edit it via the Resource Manager/Browser? You should be able to modify the style without a script, if you're not looking to automate the process. -Josh 1 Quote Link to comment
rebu1985 Posted February 27, 2017 Author Share Posted February 27, 2017 Im using the VW 14 and the only options to choose are Apply, Import and Reference in the Resource Browser so I cant modify manually. Quote Link to comment
JBenghiat Posted February 27, 2017 Share Posted February 27, 2017 Ah, you're looking at the text style in either a template file or the default text styles. In the Resource Browser, click on the Home icon, which will show you the current document. You shoild then be able to edit the text style (and any other resource). If you want to change the attributes of the default text styles, open a blank file and either define text styles via the Text menu or import them with the resource browser. Use the User Data tab of Vectorworks preferences to identify the location of your user data folder on your hard drive. Save the file to /Libraries/Defaults/Text Styles. HTH, Josh Quote Link to comment
rebu1985 Posted February 28, 2017 Author Share Posted February 28, 2017 Thanks guys, i was checking the Resource Browser as you mentioned and it´s true, its really easy to do it manually!! 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.