insert block or note into all sheets of a dwg in the same location?
Apr 12, 2004 2 Replies
Z
Zander
Hi All,
I've been working a large project for a client. Near the end now and I'm looking at 9 10+ pg drawings and about 20 2 page drawings. I've belatedly realized a deficiency in my rev code documentation! Because of the way these drawings are being distributed I need to insert a note that contains
3 file properties but I need that note on every page of every drawings in the same place...
I've made a block of the note but that's about it. I thought I would seek professional help first. ie: existing macros or other automated techniques.
TIA
Zander
Didn't find your answer? Ask the community — no account required.
C
Corey Scheich
Here is some code that I have used it isn't my best work I was just learning when I wrote it and I didn't do great error handling. It will get you started anyway.
'this function will insert the block at a location 'depending on which template is used Function insertBlock() As SldWorks.BlockDefinition
Dim x As Double Dim y As Double Dim Bscale As Double Dim RevLev As Object Dim RLX As Double Dim RLY As Double Dim RLHeight As Double Dim RevLevTxt As String Dim SheetSize As String Dim blockDef As SldWorks.BlockDefinition Dim MyBlock As SldWorks.BlockInstance
Set blockDef = dwgdoc.GetBlockDefinition("A CHANGE") dwgdoc.EditSheet
If blockDef Is Nothing Then MsgBox "There was a problem finding the block." & VBA.Chr(vbKeyReturn) & _ "Make sure " & VBA.Chr(34) & "A Change.SLDBLK" & VBA.Chr(34) & "is in the same directory as this macro." End End If Set insertBlock = blockDef
End Function
'this will update the fields of the block with the text typed into the form fields. Public Sub UpdateBlock(BlockName As SldWorks.BlockInstance)
"Zander" wrote in message news:Xns94C99ADCADD88sig6667.245txjh@216.40.28.71...
W
Warren
You can insert an Excel workbook object on the first sheet and it will show on all sheets, right click over the object to for the toggle. I believe you can insert file properties into an Excel workbook, by renaming the columns or cells , but I don't remember the procedure.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.