MaxStudio Posted February 2, 2012 Share Posted February 2, 2012 If I want to use SelectObj to select a font I can use the following: SelectObj(FOT='name of the font'); If I want to use SelectObj to select a line weight I can use the following: SelectObj(LW=4); I've gotten this information from posting in the forums. My question, is there an appendix or some place I can go online to understand the criteria? Why is it 'FOT' for font? why is it 'LW' for line weight? Thanks Derek Quote Link to comment
MaxStudio Posted February 2, 2012 Author Share Posted February 2, 2012 btw i'm trying to to select a specific font but I only want to select the font if it has bold checked. Is that possible? Quote Link to comment
Pat Stanford Posted February 2, 2012 Share Posted February 2, 2012 My question, is there an appendix or some place I can go online to understand the criteria? Why is it 'FOT' for font? why is it 'LW' for line weight? The Vectorscript Appendix is what you need Look at Appendix E Miscellaneous Selectors. In VW2012 it is located at: file:///Applications/Vectorworks%202012/VWHelp/VectorScript%20Reference/Appendix/Appendix.html It should be somewhere similar in VW2008. Why are they named what they are? The original programmers preference. Quote Link to comment
Pat Stanford Posted February 2, 2012 Share Posted February 2, 2012 btw i'm trying to to select a specific font but I only want to select the font if it has bold checked. Is that possible? Using the standard selectors, your only options for fonts are font (FOT) and font size (FSZ). If you really need to select by Bold, I would use ForEachObject with a either the specific font or all text in general as the criteria. The callback procedure would then check to see if the font is bold and select it if it is. Quote Link to comment
MaxStudio Posted February 2, 2012 Author Share Posted February 2, 2012 If you really need to select by Bold, I would use ForEachObject with a either the specific font or all text in general as the criteria. The callback procedure would then check to see if the font is bold and select it if it is. But how would I script that? ForEachObj(font, ?????)? i'm not sure how to correctly script the criteria.... Quote Link to comment
Pat Stanford Posted February 2, 2012 Share Posted February 2, 2012 Procedure Test; {Demo to show the use of ForEachObject to select text that is bold} {To change this to only handle a certain font change the criteria} {in the ForEachObject command to T=Text to something like} {((FOT='Arial'))} {February 2, 2012} {? 2012, Coviana, Inc - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Procedure CallBack(H1:Handle); Begin if (GetTextStyle(H1,1)=1) then SetSelect(H1); End; Begin DSelectAll; ForEachObject(CallBack,((T=TEXT))); End; Run(Test); Quote Link to comment
JBenghiat Posted February 2, 2012 Share Posted February 2, 2012 The VectorScript Language Guide, which is available through the help system explains criteria in more detail. Also, as you are learning, try the Custom Selection menu item, and choose the create script option. You can then edit the script. Also, in the script editor, you can select criteria through a pull down menu system via the menu at the top-left of the editor window. -Josh Quote Link to comment
Miguel Barrera Posted February 2, 2012 Share Posted February 2, 2012 But how would I script that? ForEachObj(font, ?????)? i'm not sure how to correctly script the criteria.... Why don't you use the "Criteria" menu in the script editor to build the string? This is the same dialog used for building the selection criteria. Most likely, most of us old scripters use an external editor so we forget about this feature found in the vs editor. Quote Link to comment
MaxStudio Posted February 3, 2012 Author Share Posted February 3, 2012 But how would I script that? ForEachObj(font, ?????)? i'm not sure how to correctly script the criteria.... Why don't you use the "Criteria" menu in the script editor to build the string? This is the same dialog used for building the selection criteria. Most likely, most of us old scripters use an external editor so we forget about this feature found in the vs editor. I use TextWrangler. I'm using VW2008 is this feature in this version of the script editor? Quote Link to comment
MaxStudio Posted February 3, 2012 Author Share Posted February 3, 2012 Pat, I really appreciate your example. I'll give it a try and let you know how it turns out. Thank You Derek Quote Link to comment
Miguel Barrera Posted February 3, 2012 Share Posted February 3, 2012 I use TextWrangler. I'm using VW2008 is this feature in this version of the script editor? TextWrangler is an external editor. I am referring to the vectorscript editor and this menu is available in all vw versions since criteria procedures were introduced in the late 1990's. Quote Link to comment
MaxStudio Posted February 3, 2012 Author Share Posted February 3, 2012 Thanks Pat it worked exactly as I needed it to. I'm switching from not using Quartz Imaging to using Quartz Imaging and it is messing with some of my fonts. This is going to make it a lot easier for me to fix some of my older drawings. I appreciate it. Derek Quote Link to comment
MaxStudio Posted February 3, 2012 Author Share Posted February 3, 2012 Miguel, I found it! I'm so use to working in the external editor because eveything is color coded and I found it to be easier. The criteria menu is definitely going to be useful in the future. Thanks Derek 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.