Hello to all,
i´ve grouped some shapes to a shaperange and
some other shapes to another shaperange using VBA
How to group these two ShapeRages?
Thanks a lot
Thanks for the Help!
But it is not succesful
My Shapes Ranges both contains different Type of Shapes, mainly Lines and Circles and Text. So, i need something like
Dim sr1, sr2, sr_complete as ShapeRange
sr_Complete = sr1 + sr2
dim sr_Complete as New ShapeRange
sorry, still doesn´t work. So please see my code..
Dim s1 As Shape Dim sGroup As Shape Dim sr1 As New ShapeRange Dim sr2 As New ShapeRange Dim sr_G As New ShapeRange
For i = LBound(pkx) To UBound(pkx) Set s1 = ActiveLayer.CreateEllipse2(pkx(i), pky(i), 0.05, 0.05) s1.Fill.ApplyNoFill s1.Outline.SetPropertiesEx 0.1, OutlineStyles(0), CreateCMYKColor(0, 0, 0, 100), ArrowHeads(0), ArrowHeads(0), cdrFalse, cdrFalse, cdrOutlineButtLineCaps, cdrOutlineMiterLineJoin, 0#, 100, MiterLimit:=5#, Justification:=cdrOutlineJustificationMiddle sr1.Add s1 Next
If tbNum.Value = True ThenSet s1 = ActiveLayer.CreateArtisticText(prx(i), pry(i) - 7, vtxt) ' & " m") s1.Stretch 2.5 s1.Fill.UniformColor.CMYKAssign 0, 0, 0, 100 s1.Outline.SetNoOutline sr2.Add s1 End If
'Finish with "Making Shapes"
'Now group sr1 and sr2
'and Group sr1 + sr2 to sr_G
' Set sGroup = sr.Group sr_G.AddRange sr1 ' Set sGroup = sr2.Group sr_G.AddRange sr2
Thanks for your patience ;-)DC
I am sure that you know exactly what you want to accomplish - but I am still not sure that I know what that is.
I don't think the answer is difficult, but I want to be sure that I understand the question.
I´m sorry. I just wanted not the whole Code for better viewing but i forgot a for .. next...
is a Curve and a numer of ellipses and a number of Rectangles
is a number of ArtisticTextShapes and probably a number of other Ellipses
And there are more other type of Shapes and ShapeRanges in the page that must not be included
Thanks for your patience again ;-)DC
Do you need to have any "groups that contain groups"?
Here is an example that:
Dim srEllipses As New ShapeRange
Dim sEllipseThis As Shape
Dim sEllipsesGrouped As Shape
Dim srRectangles As New ShapeRange
Dim sRectangleThis As Shape
Dim sRectangelsGrouped As Shape
Dim srBothGroups As New ShapeRange
Dim sBothGroups As Shape
Dim i As Long
For i = 1 To 10
Set sEllipseThis = ActiveLayer.CreateEllipse2(0, 0, i)
Set sEllipsesGrouped = srEllipses.Group
For i = 1 To 10
Set sRectangleThis = ActiveLayer.CreateRectangle2(0, 0, i * 2, i)
Set sRectangelsGrouped = srRectangles.Group
Set sBothGroups = srBothGroups.Group
As usualy it is that simply...
But i never would have found out!
Thanks very much !
and thanks for your patience!
It can be confusing that a range of shapes, when grouped, becomes a shape!
One last Question please for this:
how to select the sBothGroups, so that when the makro is finished you can grap all..?