Added video explanation in the comments.
I'm trying to align the package text to this price group but I'm having trouble. I usually have multiple prices on a banner so the price group name would have to be unique. Like "Price 1" or "$12.99". Not sure how to go about this. Thanks!
Private Sub Make_Click() Dim Dlr As Shape Dim Cnt As Shape Dim Sym As Shape Dim Tax As Shape Dim Pk As Shape Dim Price As Shape Dim TextType As String Dim x As Double, y As Double, w As Double, h As Double Const space_dist As Double = 0.1 Dim sr As New ShapeRange Set Dlr = ActiveLayer.CreateArtisticText(0, 0, PriceFrm.Dollar.Value, , , "Gotham Bold", 100) Set Cnt = ActiveLayer.CreateArtisticText(0, 0, PriceFrm.Cents.Value, , , "Gotham Bold", 50) Set Sym = ActiveLayer.CreateArtisticText(0, 0, "$", , , "Gotham Bold", 50) Set Tax = ActiveLayer.CreateArtisticText(0, 0, PriceFrm.Tax_Options.Value, , , "Gotham Bold", 9, , , , cdrCenterAlignment) 'Cent Position Cnt.AlignToShape cdrAlignTop, Dlr Cnt.LeftX = Dlr.RightX + space_dist '$ Position Sym.AlignToShape cdrAlignTop, Dlr Sym.RightX = Dlr.LeftX - 0.07 'Tax Position Cnt.GetBoundingBox x, y, w, h Tax.SetSize w Tax.AlignToShape cdrAlignHCenter, Cnt Tax.TopY = Cnt.BottomY - 0.07 'Select & Group Price sr.Add Dlr sr.Add Cnt sr.Add Sym sr.Add Tax sr.Group.Name = "Price" sr.GetBoundingBox x, y, w, h 'Add Package If Pk_MultiPage.Value = 0 Then Set Pk = ActiveLayer.CreateArtisticText(0, 0, Pk_Options_Std.Value, , , "Gotham Bold", 9, , , , cdrCenterAlignment) Pk.SetSize w Pk.AlignToShape cdrAlignHCenter, Group.Name = "Price" Else If Pk_MultiPage.Value = 1 Then Set Pk = ActiveLayer.CreateArtisticText(0, 0, Pk_Options_Stk.Value, , , "Gotham Bold", 9, , , , cdrCenterAlignment) Else If Pk_MultiPage.Value = 2 Then Set Pk = ActiveLayer.CreateArtisticText(0, 0, Pk_Options_Nw.Value, , , "Gotham Bold", 9, , , , cdrCenterAlignment) End If End If End If End Sub
Here's the video.
You don't necessarily have to use "alignment" methods.
Both Shape and ShapeRange have properties for SizeWidth, SizeHeight, CenterX, BottomY, etc., and those are not read-only properties. You can not only "get" them, but you can also "let" them to set values.
So, you could do something like:
Shape.TopY = ShapeRange.BottomY - 0.25
to move Shape so that it is 0.25 below ShapeRange.
Similarly, you could use something like:
Shape.CenterX = ShapeRange.CenterX
to center Shape horizontally relative to ShapeRange.
Thank you! That got me in the right direction.