Replace model connectet to tItle block, in drawing

Replace model connectet to tItle block, in drawing

Patrick1323
Enthusiast Enthusiast
388 Views
1 Reply
Message 1 of 2

Replace model connectet to tItle block, in drawing

Patrick1323
Enthusiast
Enthusiast
Hello, When i make a drawing, Inventor uses the first placed model propertys to fill out the title block. My problem: I have multiple models on the drawing and I want to change quickly the model connectet to the title block. How can I do that?
0 Likes
389 Views
1 Reply
Reply (1)
Message 2 of 2

k14348
Advocate
Advocate

 

SyntaxEditor Code Snippet
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
If oSSet.count = 0 Then
    MessageBox.Show("You must select a drawing view first", "iLogic")
Exit Sub
End If

'Reference to the drawing view from the 1st selected object
Dim oView As DrawingView = trycast(oSSet.item(1), DrawingView)

If oView IsNot Nothing Then
    Dim osheet, oNewSheet As Sheet
    osheet = oView.Parent
    Dim oDoc As DrawingDocument
    oDoc = osheet.Parent
   
    ' Wrapping activities in a transaction so the
    ' entire process can be undone with a single undo operation.
    Dim trans As Transaction
    trans = ThisApplication.TransactionManager.StartTransaction(oDoc, "Move First View")
   
    'add a new sheet and copy all drawing views there
    oNewSheet = oDoc.Sheets.Add
    Call oView.MoveTo(oNewSheet)
   
    For Each oOtherView In osheet.DrawingViews
            Call oOtherView.MoveTo(oNewSheet)           
    Next
   
    'Copy back the views to original sheet and delete the new sheet created
    For Each oOtherView In oNewSheet.DrawingViews
        Call oOtherView.MoveTo(osheet)
    Next
   
    Call oNewSheet.Delete
    Call osheet.Update
   
    trans.End

Else
    MessageBox.Show("The selected object is not a drawing view", "iLogic")
End If

use the above ilogic rule. It will solve your issue.

If you found this useful. Please Accept this as solution

 

0 Likes