Jump to content
Developer Wiki and Function Reference Links ×

Modify a text style


rebu1985

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

Link to comment

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
Link to comment

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

Link to comment

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.

×
×
  • Create New...