Jump to content

Make all attributes by class


bohlr

Recommended Posts

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.

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

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

Link to comment
  • 2 years later...
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.

 

59c034d09cc34_ScreenShot2017-09-18at4_56_27PM.jpg.374f7f3425c259261897719843c091a3.jpg

 

three years of using it and just stumbled across this 

Link to comment

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);

 

  • Like 2
Link to comment
  • 2 years later...
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...

 

  • Like 1
Link to comment
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 🤣😉

Link to comment

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);

 

  • Like 1
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...