Hello!
I'm trying to create a sketch on my drawing with the text: "Não Produzir!" (Not for Reproducing!)
Adding the text as sketch (or as a "Annotate>Text") is fine by me.
My code will also change the style of the Title Block references to the model, in all the document sheets (wich I don't want).
Dim oDrawingDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDrawingDoc.ActiveSheet oSheetMidX = (ThisDrawing.ActiveSheet.Width * 0.1) / 2 oSheetMidY = (ThisDrawing.ActiveSheet.Height * 0.1) / 2 oTrans = ThisApplication.TransactionManager.StartTransaction(ThisApplication.ActiveDocument,"Não Produzir!") Dim oSketch As DrawingSketch oSketch = oDrawingDoc.ActiveSheet.Sketches.Add oSketch.Name = "• Não Produzir •" oSketch.Edit Dim oTG As TransientGeometry oTG = ThisApplication.TransientGeometry Dim sText As String sText = "Drawing Notes" Dim oTextBox As TextBox oTextBox = oSketch.TextBoxes.AddFitted(oTG.CreatePoint2d(0, 0), "") oTextBox = oSketch.TextBoxes.AddFitted(oTG.CreatePoint2d(oSheetMidX, oSheetMidY), "Não Produzir!") oTextBox.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextCenter oTextBox.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextMiddle oSketch.TextBoxes.Item(1).Style.Bold = True oSketch.TextBoxes.Item(1).Style.FontSize = "4.2" oSketch.ExitEdit oTrans.End
Before firing rule:
After:
Does anyone know how to only apply the new style on the sketch I created?
Thanks!
João Silva
Mechanical Engineer
Solved! Go to Solution.