Jump to content
Developer Wiki and Function Reference Links Read more... ×
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

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.

×