Jump to content

Andy Goar

Member
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Many thanks for the idea. I had tried that, though I stripped it out of the script in the file I shared. I just added it back in, just ot be sure. The script still does not work as expected. Here is the updated script code. Is this what you had in mind (see comments)? import vs def ModifyInnerSymDropShadows(BaseSym): BaseSymName = vs.GetSDName(BaseSym) #print("Adding shadows to inner symbols for base: " + BaseSymName); innerSym = vs.FInGroup(BaseSym) while (innerSym): vs.SetDropShadowData(innerSym, 1, 15.0, 0.01 ,290.0 ,100, (0,35466,14649)) vs.EnableDropShadow(innerSym, True) vs.ResetObject(innerSym) # Added this as per JBenghiat's suggestion vs.ResetBBox(innerSym) #print(" Inner object found, and shadows added") innerSym = vs.NextObj(innerSym) # Main code. Walks through all symbols in "BaseSymbols" folder, and calls routine # to add drop shadows. BaseSymList, BaseSymCount = vs.BuildResourceList(16, 0, 'BaseSymbols') for BaseSymIndex in range(1, BaseSymCount + 1): currSym = vs.GetResourceFromList(BaseSymList, BaseSymIndex) ModifyInnerSymDropShadows(currSym) vs.ResetObject(currSym) # Added this as per JBenghiat's suggestion vs.ReDrawAll() Again, what really gets me, is that one embeded symbol, the one that was added when the outer symbol was first created, gets the drop shadow just fine. The 'print' statements showed me that the other symbol, the one that was added when I edited the outer symbol later, does have the SetDropShadowData/EnableDropShadow operations applied to it. But the shadow just does not show up. But if I manually add a drop shadow, then rerun the script, everything works. Again, thank you so much for posting your idea. Any other thoughts you may have are GREATLY appreciated. This issue is really stopping up some plans we have. Andy
  2. Hey all; I'm having issues with a python script that attempts to configure and turn on drop shadows (ie vs.SetDropShadowData and vs.EnableDropShadow) on symbols embedded within symbols. The code works on the embedded symbols that were origionally added, when the 'outer' symbol was first created. But if I edit the outer symbol, and add new symbiol instances within it, the script fails to work on the new symbols. Details and a test file are below. Attached Document has two Symbols, and a test script in it. "innerSymbol" is simply an oval, turned into a symbol. "BaseSymbol" in folder "BaseSymbols" is a square, with above 'InnerSymbol" oval added to it, then turned into a symbol. "Add Drop Shadows To Inner Symbols" is the test script. The actual script code is included separately below as well. Load the file, and run the script. The "InnerSymbol" inside "BaseSymbol" gets a green drop shadow as expected. This works fine. Now edit "BaseSymbol", and drag another "InnerSymbol" into it. Run the test script again. The new "InnerSymbol" does NOT get the green drop shadow as expected. This is the behavior that I'm trying to fix. Next manually edit the new "InnerSymbol" drop shadow parameters, and change any one of the parameters. In my case, I changed the units from "page" to "document". But editing any parameter seems to work. Run the test script yet again. This time, the new "InnerSymbol" picks up the drop shadow change just fine. - Why does the new "InnerSymbol" initially NOT pick up the drop shadow changes applied to it by the code? - Why does manually editing the drop shadow parameters, then allow the script to work as expected? - Is there any change I can make to the script to allow it to work, without needing to first manually edit drop shadow parameters? This issue also seems to happen on MacOS. Many thanks, Andy Goar MyDropShadowInnerSymbolTestDocument2.vwx
×
×
  • Create New...