Jump to content
mike mcneil

Is there way to use VS to set Attributes Palettes properties?

Recommended Posts

On occasion I will override the object creation method (either fill type, line type, color, etc.) in the Attributes Palette when I am creating a viewport frame or polyline, etc. Is there a way via a script to set those properties back to "by class" rather than having to select each property individually in the Attributes Palette. I am not trying to modify an existing object, but I would like to have the default creation method set back to "by class" for every attribute.

Thanks for your help.

Share this post


Link to post

Take a close look at the Attributes Palette. Every setting there has an option for "By Class". The all have a little black arrow pointing to the upper right in them.

Just take the parameter that needs to use the class attributes and set that attribute to the "By Class" option.

This works for any object, not just those created with "Class Attributes" turned on at their creation.

Share this post


Link to post

Not sure if it's this what you need, but if you use this script, the next (and all folowing) objects will be drawn "by class". I use it quiete a lot because i got many external drawings that where the standard attributes aren't "by class".

[font:Courier New]LSByClass;

PenColorByClass;

LWByClass;

FPatByClass;

FillColorByClass;

OpacityByClass;[/font]

Share this post


Link to post

I use this script to set back to class, I have gave it a shortcut (shift command option a) and it sets the object to class or the pallette if nothing is seleted to class defaults.

The only thing I would like to see improved in this script is the opacity and arrow to be set to class also.

{Developed ?2003 Katerina Panagiotakis}

Procedure Classdf;

var

x,y,xo,yo: Real;

h,oh,h0,hp,hx,ha,hg: Handle;

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;

SetLWByClass(ha);

SetPenColorByClass(ha);

SetfillColorByClass(ha);

SetfpatByClass(ha);

SetlsByClass(ha);

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

SetLWByClass(hg);

SetPenColorByClass(hg);

SetfillColorByClass(ha);

SetfpatByClass(ha);

SetlsByClass(ha);

end;

ha := NextSObj(hg);

WHILE ha <> NIL DO BEGIN;

SetLWByClass(ha);

SetPenColorByClass(ha);

SetfillColorByClass(ha);

SetfpatByClass(ha);

SetlsByClass(ha);

ha := NEXTSOBJ(ha);

end;

end;

end;

LSByClass;

LWByClass;

PenColorByClass;

FillColorByClass;

FPatByClass;

ReDrawAll;

end;

Run(Classdf);

Share this post


Link to post

John,

Ask and you shall receive.

This version also sets the marker and opacity to be by class.

One correction to the description though. This script always sets the defaults to ByClass even if another object is selected when you run it. It could be modified to not do so if so desired.

{Developed ?2003 Katerina Panagiotakis}

{Opacity and marker by class added 2008 Pat Stanford}

Procedure Classdf;

var

x,y,xo,yo: Real;

h,oh,h0,hp,hx,ha,hg: Handle;

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;

SetLWByClass(ha);

SetPenColorByClass(ha);

SetfillColorByClass(ha);

SetfpatByClass(ha);

SetlsByClass(ha);

SetMarkerByClass(ha); {Added Pat Stanford 2008}

SetOpacityByClass(ha); {Added Pat Stanford 2008}

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

SetLWByClass(hg);

SetPenColorByClass(hg);

SetfillColorByClass(ha);

SetfpatByClass(ha);

SetlsByClass(ha);

SetMarkerByClass(ha); {added Pat Stanford 2008}

SetOpacityByClass(ha); {added Pat Stanford 2008}

end;

ha := NextSObj(hg);

WHILE ha <> NIL DO BEGIN;

SetLWByClass(ha);

SetPenColorByClass(ha);

SetfillColorByClass(ha);

SetfpatByClass(ha);

SetlsByClass(ha);

SetMarkerByClass(ha); {Added Pat Stanford 2008}

SetOpacityByClass(ha); {Added Pat Stanford 2008}

ha := NEXTSOBJ(ha);

end;

end;

end;

LSByClass;

LWByClass;

PenColorByClass;

FillColorByClass;

FPatByClass;

MarkerByClass; {added Pat Stanford 2008}

OpacityByClass; {added Pat Stanford 2008}

ReDrawAll;

end;

Run(Classdf);

Share this post


Link to post

Please correct me if I am wrong.

The 'Attribute Palette' at the very bottom has a triangle to choose an option for "Make All Attributes by Class".

This gives the same desirable effect, doesn't it?

Share this post


Link to post

Clarification for Fundamentals users - the Attribute Palette options are only available in the Design Series products (Architect, Landmark, Spotlight, Mechanical and Designer).

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