PDA

View Full Version : make symbols with text and objects no fill and no stroke


scody
19-10-2011, 01:46
Pls see code below.
i have several symbols with text and objects that requires no fill and no stroke. I want to select symbols , select all contents (shapes & text) and make them all no fill. is my code correct?



Sub NoFill()

Dim s As Shape, s1 As Shape, sr As ShapeRange, sr2 As ShapeRange

Dim str1$, str2$

str2 = ""

Set sr = ActiveSelection.Shapes.FindContent(Query:="@content = 'symbol'")

For Each s In sr

str1 = s.Symbol.Definition.Name

If InStr("-*-" & str2 & "-*-", str1) = 0 Then

str2 = str2 & "-*-" & str1 & "-*-"

s.Symbol.Definition.EnterEditMode

Set sr2 = ActiveLayer.Shapes.FindShapes(Query:="@shape = 'shape'")

For Each s1 In sr2

s1.Fill.ApplyNoFill

Next s1

s.Symbol.Definition.LeaveEditMode

End If

Next s

sr.CreateSelection

End Sub

shelbym
15-04-2012, 00:35
Here is my version:Sub SymbolNoFillNoOutline()
Dim s As Shape, s2 As Shape
Dim sr As ShapeRange

Set sr = ActivePage.Shapes.FindShapes(Type:=cdrSymbolShape)
For Each s In sr.Shapes
s.Symbol.Definition.EnterEditMode
Set s2 = ActiveLayer.FindShape()
s2.Fill.ApplyNoFill
s2.Outline.SetNoOutline
s.Symbol.Definition.LeaveEditMode
Next s
End Sub

-Shelby