
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I am looking for some help on how to update the title block in drawings with multiple layout tabs. So far my code will only update the title block in the active layout. I was looking into using acSelectionsetall but couldn't figure out how to apply it.
'***********************************************************************
Sub ModifyFrameBlock(DWG As AcadDocument, QUANTITY As String)
Dim blk As AcadBlockReference
Dim attr As Variant
Set blk = FindFrameBlock(DWG)
If Not blk Is Nothing Then
For Each attr In blk.GetAttributes()
If attr.TagString = "RELEASE-NO" Then
attr.TextString = RelNo
DWG.SummaryInfo.SetCustomByKey "Frame No", lbFrameName ' drawing property field
DWG.SummaryInfo.SetCustomByKey "Frame Qty", QUANTITY ' drawing property field
End If
If attr.TagString = "RELEASE-DATE" Then
attr.TextString = TBReleaseDate
End If
Next
End If
CreatePDF DWG
DWG.AuditInfo FixError ' audit and fix error in drawing
DWG.PurgeAll ' purge drawing
DWG.Close True
End Sub
'***********************************************************
Function FindFrameBlock(DWG As AcadDocument) As AcadBlockReference
Dim ent As AcadEntity
For Each ent In DWG.PaperSpace
If TypeOf ent Is AcadBlockReference Then
If ent.Name = "blockname" Then
Set FindFrameBlock = ent
Exit Function
End If
End If
Next
Set FindFrameBlock = Nothing
End Function
'***********************************************************
Solved! Go to Solution.