Jump to content
rebu1985

Modify a text style

Recommended Posts

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!!

Share this post


Link to post

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?

 

Bildschirmfoto 2017-02-27 um 16.00.08.png

Edited by Patrick Winkler

Share this post


Link to post

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 

  • Like 1

Share this post


Link to post

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. 

Share this post


Link to post

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

Share this post


Link to post

Thanks guys, i was checking the Resource Browser as you mentioned and it´s true, its really easy to do it manually!!

Share this post


Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...