Textbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I have a flatpattern on witch I created a sketch with all the edges and bends project. Here's my code:
Dim partDoc As Document
Set partDoc = ThisApplication.ActiveDocument
Dim UOM As UnitsOfMeasure
Dim eLengthUnits As UnitsTypeEnum
Set UOM = partDoc.UnitsOfMeasure
eLengthUnits = UOM.LengthUnits
Dim partDef As SheetMetalComponentDefinition
Set partDef = partDoc.ComponentDefinition
If partDef.FlatPattern Is Nothing Then
partDef.Unfold
Dim partflat As FlatPattern
Set partflat = partDef.FlatPattern
Set sk = partflat.Sketches.Add(partflat.TopFace, True)
sk.Name = "CTS"
sk.Edit
Dim i As Integer
For i = 1 To sk.SketchEntities.Count
sk.SketchEntities(i).Construction = False
Next
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
Dim oRB As Box2d
Set oRB = oTG.CreateBox2d
Dim oEnt As SketchEntity
For Each oEnt In sk.SketchEntities
Call oRB.Extend(oEnt.RangeBox.MinPoint)
Call oRB.Extend(oEnt.RangeBox.MaxPoint)
Next
Set minXminY = oTG.CreatePoint2d(oRB.MinPoint.X, oRB.MinPoint.Y)
Set minXmaxY = oTG.CreatePoint2d(oRB.MinPoint.X, oRB.MaxPoint.Y)
Set maxXminY = oTG.CreatePoint2d(oRB.MaxPoint.X, oRB.MinPoint.Y)
Set maxXmaxY = oTG.CreatePoint2d(oRB.MaxPoint.X, oRB.MaxPoint.Y)
this works fine here's the result:
What I am struggling with is adding the following textbox:
MAT'L: PL. 1/8" x 3 1/2" x 11 9/16"
STEEL 44W
ITEM: STPL264-2115-1
QTY: 2
DONE BY: A.R
here, I want this textbox to be proportionnal to the rangebox of the flatpattern:
So Whatever the size of the part, I want the textbox to be positionned as shown (centered, above, font size proportionnal)
any ideas?
thanks in advance!