Message 1 of 5
Ilogic replace title block

Not applicable
02-10-2014
04:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I've a msg box asking the user what kind of drawing is he making.
If the answer is yes (6) then Inventor will change the styles and delete the current title block and »»» replaces by an other with the name Ferramentas and it does delete the current one but does not place the other named Ferramentas, any ideia why?
TIA
Dim i As String i = MessageBox.Show("Vai efectuar o desenho de uma ferramenta?", "ALUALPHA", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) If i = "6" Then ' mudar os estilos para ferramentas Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument oDoc.StylesManager.ActiveStandardStyle = oDoc.StylesManager.StandardStyles("Alualpha Ferramentas") ' defenir os title blocks Dim oTitleBlockDef1 As TitleBlockDefinition oTitleBlockDef1 = oDoc.TitleBlockDefinitions. _ Item("Alualpha") Dim Val1 As Boolean = oTitleBlockDef1.IsReferenced Dim oTitleBlockDef2 As TitleBlockDefinition oTitleBlockDef2 = oDoc.TitleBlockDefinitions. _ Item("Ferramentas") Dim Val2 As Boolean = oTitleBlockDef2.IsReferenced Dim oSheet As Sheet = oDoc.ActiveSheet Dim oTitleBlock As TitleBlock If oSheet.TitleBlock.Definition Is oTitleBlockDef1 Then oSheet.TitleBlock.Delete() oTitleBlock = (oTitleBlockDef2) End If Else 'mudar estilos para Alpha Dim oDoc1 As DrawingDocument oDoc1 = ThisApplication.ActiveDocument oDoc1.StylesManager.ActiveStandardStyle = oDoc1.StylesManager.StandardStyles("Alualpha") End If