bohlr Posted September 18, 2017 Share Posted September 18, 2017 Does anyone have a keyboard shortcut or script to make the default to "Make all attributes by class" 1 Quote Link to comment
ThreeDot Posted September 18, 2017 Share Posted September 18, 2017 You don't like clicking a 20 x 8 pixel button, then choosing an option from the fly-out menu!? I'm embarrassed to say that I've been annoyed by that tiny button for years, but have never done anything about it. 3 Quote Link to comment
Guest RMcK Posted September 18, 2017 Share Posted September 18, 2017 @bohlrI've been wanting to find a similar shortcut, but cannot locate "Make all attributes by class" as an option in edit workspace, Quote Link to comment
bohlr Posted September 18, 2017 Author Share Posted September 18, 2017 There is a drop down menu at the bottom on the attributes pallet that give a choice to make an object " make all attributes by class" or if no object is selected it makes the the default "Make all attributes by class". I was looking for a faster way than having to navigate down the attributes menu and then select an option in a drop down menu. Quote Link to comment
Kevin McAllister Posted September 18, 2017 Share Posted September 18, 2017 You could try this script - It is for an older version so it doesn't set things like the drop shadow. Someone here may be able to help you update it. Kevin Quote Link to comment
bohlr Posted September 18, 2017 Author Share Posted September 18, 2017 At first try it works very nicely Thank you Quote Link to comment
Art V Posted September 20, 2017 Share Posted September 20, 2017 On 9/18/2017 at 11:43 PM, bohlr said: There is a drop down menu at the bottom on the attributes pallet that give a choice to make an object " make all attributes by class" or if no object is selected it makes the the default "Make all attributes by class". I was looking for a faster way than having to navigate down the attributes menu and then select an option in a drop down menu. Another option could be to set the class to automatically apply the class definitions to objects when they are created in that class. This might solve most class issues when creating them. (Or move them to another class) Quote Link to comment
Bret Posted September 25, 2017 Share Posted September 25, 2017 On 9/18/2017 at 2:18 PM, RMcK said: @bohlrI've been wanting to find a similar shortcut, but cannot locate "Make all attributes by class" as an option in edit workspace, Just to mention it in case it makes a difference, for some reason this is a Design Series-only option... It's a strangely arbitrary thing to omit from Fundamentals, but it doesn't seem to me that the logic as to what's in or out is particularly consistent. Quote Link to comment
rexwexford Posted May 21, 2020 Share Posted May 21, 2020 On 9/18/2017 at 10:08 PM, ThreeDot said: You don't like clicking a 20 x 8 pixel button, then choosing an option from the fly-out menu!? I'm embarrassed to say that I've been annoyed by that tiny button for years, but have never done anything about it. three years of using it and just stumbled across this Quote Link to comment
Pat Stanford Posted May 25, 2020 Share Posted May 25, 2020 And here is an update to the 2008 update of the script to set Attributes by Class. Two notes. 1. There does not appear to be a scriptable way to set TextStyle to by class on a document wide basis. 2. Changes selected objects. If no object selected then the Document defaults are switched to by class. {Developed ?2003 Katerina Panagiotakis} {Opacity and marker by class added 2008 Pat Stanford} {Drop Shadow and TextStyle by class added 2020 Pat Stanford} Procedure Classdf; var x,y,xo,yo: Real; h,oh,h0,hp,hx,ha,hg: Handle; B1:Boolean; {added 2020 by Pat Stanford for DocDropShadowByCl} message:integer; begin ha:=LSActLayer; GetOrigin(xo,yo); Locus(-xo,-yo); h0:=LNewObj; hp:=GetParent(h0); DelObject(h0); if GetType(hp)<>11 then begin if ha<>nil then begin ha := FSACTLAYER; WHILE ha <> NIL DO BEGIN; SetDropShadowByCls(ha, True); {Added Pat Stanford 2020} SetFillColorByClass(ha); SetFPatByClass(ha); SetLSByClass(ha); SetLWByClass(ha); SetMarkerByClass(ha); {Added Pat Stanford 2008} SetOpacityByClass(ha); {Added Pat Stanford 2008} SetPenColorByClass(ha); SetTextStyleByClass(ha); {Added Pat Stanford 2020} ha := NEXTSOBJ(ha); end; end; end; if GetType(hp)=11 then begin hg:=FInGroup(hp); ha := NextSObj(hg); if ha<>nil then begin if Selected(hg) = true then begin SetDropShadowByCls(ha, True); {Added Pat Stanford 2020} SetFillColorByClass(ha); SetFPatByClass(ha); SetLSByClass(ha); SetLWByClass(ha); SetMarkerByClass(ha); {Added Pat Stanford 2008} SetOpacityByClass(ha); {Added Pat Stanford 2008} SetPenColorByClass(ha); SetTextStyleByClass(ha); {Added Pat Stanford 2020} end; ha := NextSObj(hg); WHILE ha <> NIL DO BEGIN; SetDropShadowByCls(ha,True); {Added Pat Stanford 2020} SetFillColorByClass(ha); SetFPatByClass(ha); SetLSByClass(ha); SetLWByClass(ha); SetMarkerByClass(ha); {Added Pat Stanford 2008} SetOpacityByClass(ha); {Added Pat Stanford 2008} SetPenColorByClass(ha); SetTextStyleByClass(ha); {Added Pat Stanford 2020} ha := NEXTSOBJ(ha); end; end; end; B1:=DocDropShadowByCls; FillColorByClass; FPatByClass; LSByClass; LWByClass; MarkerByClass; {added Pat Stanford 2008} OpacityByClass; {added Pat Stanford 2008} PenColorByClass; {There does not appear to be a VS procedure to set set Text Style by class for hte document as of VW2020} ReDrawAll; end; Run(Classdf); 2 Quote Link to comment
Andy Broomell Posted November 22, 2022 Share Posted November 22, 2022 Hi @Pat Stanford! I use this script all the time with a keyboard shortcut (Cmd+Y) and it's immensely helpful. Saves me a lot of time, thank you! However, it seems to not work in certain contexts. For example, I don't think it works when editing inside of a Symbol. Is there something in the code preventing this? Quote Link to comment
Pat Stanford Posted November 22, 2022 Share Posted November 22, 2022 The other way around Andy, its not that there is something in the code preventing it working in Symbols, it is that there is nothing in the code specifically handling being in a symbol def. I will try and format it and clean it up later today. Quote Link to comment
Boh Posted November 22, 2022 Share Posted November 22, 2022 I have noticed that in vw 2023 the make all attributes by class button turns the class line markers on. Previous versions didn’t do this. 1 Quote Link to comment
Pat Stanford Posted November 22, 2022 Share Posted November 22, 2022 I am not seeing that in VW2023 SP2. There was actually a change made to to this in VW2022 but it was rolled back in (I think) SP3 to set everything by class except for Markers. Can you try the latest SP and confirm what you are seeing? Is this a file that started in a previous version? What happens in a new blank file? Quote Link to comment
Andy Broomell Posted November 22, 2022 Share Posted November 22, 2022 37 minutes ago, Boh said: I have noticed that in vw 2023 the make all attributes by class button turns the class line markers on. Previous versions didn’t do this. See this thread: https://forum.vectorworks.net/index.php?/topic/92650-vw2022-line-endpoint-style-always-visible-when-make-all-attributes-by-class/ And maybe this one: https://forum.vectorworks.net/index.php?/topic/92770-2022-class-marker-style-no-none/ Apparently it's still not fixed on Windows, according to some users? Working correctly for me on Mac... 1 Quote Link to comment
Andy Broomell Posted November 22, 2022 Share Posted November 22, 2022 1 hour ago, Pat Stanford said: 1 hour ago, Andy Broomell said: Is there something in the code preventing this? The other way around Andy, its not that there is something in the code preventing it working in Symbols, it is that there is nothing in the code specifically handling being in a symbol def. Or the other way other way around... the thing that's IN the code is the ABSENCE of the code specifically handling being in a symbol def 🤣😉 Quote Link to comment
Pat Stanford Posted November 22, 2022 Share Posted November 22, 2022 Try this one. Exceedingly lightly tested, so use at your own risk. Procedure Classdf; {Developed ?2003 Katerina Panagiotakis} {Opacity and marker by class added 2008 Pat Stanford} {Drop Shadow and TextStyle by class added 2020 Pat Stanford} {Refactored and ability to work in Symbol Defs added 2022 Pat Stanford} var x,y,xo,yo: Real; h,oh,h0,hp,hx,ha,hg: Handle; B1:Boolean; {added 2020 by Pat Stanford for DocDropShadowByCl} message:integer; {sub procedure to set object attributes by class} Procedure SetAttributes; BEGIN WHILE ha <> NIL DO BEGIN SetDropShadowByCls(ha, True); {Added Pat Stanford 2020} SetFillColorByClass(ha); SetFPatByClass(ha); SetLSByClass(ha); SetLWByClass(ha); SetMarkerByClass(ha); {Added Pat Stanford 2008} SetOpacityByClass(ha); {Added Pat Stanford 2008} SetPenColorByClass(ha); SetTextStyleByClass(ha); {Added Pat Stanford 2020} ha := NEXTSOBJ(ha); end; End; begin {This is the Where's Waldo method to determine the parent of the object} ha:=LSActLayer; GetOrigin(xo,yo); Locus(-xo,-yo); {create locus where we are (Waldo)} h0:=LNewObj; hp:=GetParent(h0); {Get parent of Waldo. Same parent of what we care about} DelObject(h0); {Parent determines how to access objects} {Type of 31 is a Layer} if GetType(hp)=31 then begin ha := FSACTLAYER; if ha<>nil then begin SetAttributes; end; end; {Type of 11 is Group} if GetType(hp)=11 then begin hg:=FInGroup(hp); {Find the correct first selected in the group} If Not Selected(hg) then ha := NextSObj(hg) else ha := hg; if ha<>nil then begin SetAttributes; end; End; {Type of 16 is Symbol Definition} if GetType(hp)=16 then begin hg:=FInGroup(hp); {Find the correct first selected in the Symbol Def} If Not Selected(hg) then ha := NextSObj(hg) else ha := hg; if ha<>nil then begin SetAttributes; end; End; {set file defaults for ByClass} B1:=DocDropShadowByCls; FillColorByClass; FPatByClass; LSByClass; LWByClass; MarkerByClass; {added Pat Stanford 2008} OpacityByClass; {added Pat Stanford 2008} PenColorByClass; {There does not appear to be a VS procedure to set set Text Style by class for hte document as of VW2020 or VW2023} ReDrawAll; end; Run(Classdf); 2 Quote Link to comment
Andy Broomell Posted November 22, 2022 Share Posted November 22, 2022 Seems to be working so far! You're a lifesaver as always. Quote Link to comment
Boh Posted November 22, 2022 Share Posted November 22, 2022 Thanks @Pat Stanford! Quote Link to comment
E|FA Posted September 13, 2023 Share Posted September 13, 2023 For anyone interested, I started a Wishlist item to add a button to the Attributes palette. Please visit & vote: 1 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.