herbieherb Posted June 20, 2019 Share Posted June 20, 2019 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. Quote Link to comment
Pat Stanford Posted June 20, 2019 Share Posted June 20, 2019 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. Quote Link to comment
herbieherb Posted June 21, 2019 Author Share Posted June 21, 2019 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? Quote Link to comment
herbieherb Posted June 21, 2019 Author Share Posted June 21, 2019 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 ) 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.