Copy link to clipboard
Copied
Hi Everyone,
I've been working on this for a LONG while and just don't understand it. Here's what I am doing (in VB):
I duplicate a symbol, add it 4 times to layer1 (with some massaging to each added reference). Variable 'aLayer' is the first layer (trust me, I've checked it 2.742 times ). When I refer to the AI UI and refresh it just before the line in RED executes, everything shows just fine - those little buggers are on layer1, just where they are supposed to be. Then when I execute the 'delete' to break the link, it moves the pathitems to layer 2.
If I try the same on Layer2, (there's only 2 layers), the copies go to layer 2. If I add a third layer to diagnose the problem using the layer 2 variables, the copies go to layer3.
Any ideas what I am doing wrong?
Thanks so much in advance for your help!
TT
Here's the code:
...
Dim tmpCenterWidget = aDoc.Symbols.GetByName("CenterWidget").Duplicate
Dim widgetLeft = DrawCenterWidgets(aDoc, "_WidgetLeft_" & aLayer.Name, tmpCenterWidget, 180, yCenter + 18, x1)
Dim widgetRight = DrawCenterWidgets(aDoc, "_WidgetRight_" & aLayer.Name, tmpCenterWidget, 0, yCenter + 18, x2 - 18)
Dim widgetTop = DrawCenterWidgets(aDoc, "_WidgetTop_" & aLayer.Name, tmpCenterWidget, 90, y1, xCenter - 18)
Dim widgetBottom = DrawCenterWidgets(aDoc, "_WidgetBottom_" & aLayer.Name, tmpCenterWidget, -90, y2 + 18, xCenter - 18)
tmpCenterWidget.Delete() ' deletes temp widget symbol duplicate which breaks symbols to paths
'GroupSelectedObjects(app, "_GroupWidgets_")
aDoc.Selection = vbEmpty 'deselects all
app.Redraw()
Return True
End Function
Private Function DrawCenterWidgets(aDoc As AI.Document, widgetName As String, baseSymbol As Illustrator.Symbol, rotate As Double, top As Double, left As Double)
Dim aLayer = aDoc.ActiveLayer
Dim newSymbol = aLayer.SymbolItems.Add(baseSymbol)
newSymbol.Rotate(rotate)
newSymbol.Top = top
newSymbol.Left = left
newSymbol.Name = widgetName
Return newSymbol
End Function
...those little buggers...before we go crazy, try adding symbol items by hand, then delete the symbol by hand too, everything's in place, good. Now undo, create a new script, write 2 lines of code to delete the symbol...aha!!, all symbol instances move to the top layer...can we say bug? probably, I tried VB and JS, same results.
Copy link to clipboard
Copied
...those little buggers...before we go crazy, try adding symbol items by hand, then delete the symbol by hand too, everything's in place, good. Now undo, create a new script, write 2 lines of code to delete the symbol...aha!!, all symbol instances move to the top layer...can we say bug? probably, I tried VB and JS, same results.
Copy link to clipboard
Copied
Hi Carlos!
Thanks for your reply. Yeah, looks like a bug to me too. I added about 5 blank layers above the 2nd layer, made the first layer active, deleted the symbol instance and the replacement pathitems were inserted into the 7th layer (top layer). Didn't know if that's what you meant by the "top layer" so I figured I'd test the bug a little more. How do you report bugs to Adobe since they don't seem to hang around here much?
Thanks for your assistance.
TT
Copy link to clipboard
Copied
One more thing -- which is definitely a sign of a bug is that upon the deletion/removal of the symbol, when thebroken instances are sent to the top layer, THAT layer then becomes the active layer. If the coder is unaware of this issue, THAT could cause an equal or greater amount of consternation....
Copy link to clipboard
Copied
the layer becomes active because the broken symbol items get selected....so, what's next?
bug report
https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Copy link to clipboard
Copied
Yup, makes sense. Thanks, Carlos. I'll submit a bug report.