Jump to content
herbieherb

set shadow by class

Recommended Posts

I'm trying to make a script, that sets all attribtues by class, but i can't find a way to set the shadow settings by class.

Share this post


Link to post

SetDropShadowByCls( h:HANDLE;   byClassValue:BOOLEAN) ;

 

Sets the check box for Use Class Drop Shadow in VW2019, but there seems to be a bug as the shadow does not actually display until you hit the Edit Shadow button in the OIP.

 

I have tried the usual tricks of ResetObject and RedrawAll, but none of them cause the shadow to draw until you click the Edit Shadow button. It does not even matter if you click OK, as long as the dialog opens, the shadow draws when it closes.

Share this post


Link to post

Thank you very much, I didn't know that there are any additional commands that are not in the function reference. SetDropShadowByCls worked fine.

What surprised me a bit is that a command to set the default shadow in the attributes palette to class attributes is missing. Even if you press the button 'Assign class styles' in the attributes palette, the shadow is not set according to class.
Was this forgotten when the shadow option was added?

Share this post


Link to post

Here is the python-script i made. It works just like the 'Make All Attributes By Class' - Button in the Attributes Palette. It's meant to add as a menu commant to allow to use it with a hotkey.

 

#v1.3
#by Herbieherb 2019
#enhanced by MRoth

def SetClassAttributes(h):
    vs.SetFillColorByClass(h)
    vs.SetLSByClass(h)
    vs.SetLWByClass(h)
    vs.SetMarkerByClass(h)
    vs.SetOpacityByClass(h)
    vs.SetPenColorByClass(h)
    vs.SetTextStyleByClass(h)
    vs.SetFPatByClass(h)
    vs.SetDropShadowByCls(h, True)
    vs.SetSelect(h)

objs = []

def Count_Objs(h):
    objs.append(h)

vs.ForEachObjectInLayer( Count_Objs, 2, 0, 2 )


if len(objs) == 0:
    vs.FPatByClass()
    vs.FillColorByClass()
    vs.LSByClass()
    vs.LWByClass()
    vs.MarkerByClass()
    vs.OpacityByClass()
    vs.PenColorByClass()
    
    h = vs.FActLayer()
    vs.SetSelect(h)
    vs.SetDSelect(h)
else:
    vs.ForEachObjectInLayer( SetClassAttributes, 2, 0, 2 )

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