AttachExternalReference

AttachExternalReference

Anonymous
Not applicable
229 Views
1 Reply
Message 1 of 2

AttachExternalReference

Anonymous
Not applicable
Howdy everyone!

Wanted to drop somethin' by you all.. see if anyone had an idea for a better (faster) implementation. I am inserting xref title-blocks into several tabs.. it is particularly slow because the app has to activate each tab in order to add the xref. So I thought "hey! what if I just dropped them into each layout from the block collection! Then I wouldn't have to activate the tab, thus increasing speed significantly!"

The problem is... well, it doesn't work. It will only add the xref to an active layout, even if I call the attachexternalreference function from a particular inactive layout object.

Any ideas? Suggestions?

Original Working Code:
For Each layout In doc.layouts
If layout.Name Like "11X17*" Then
doc.SetVariable "CTAB", layout.Name 'Activate tab
Set xrTB = doc.PaperSpace.AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False)
End If
Next layout

New, not working code:
For i = 0 To doc.Blocks.count - 1
If doc.Blocks.Item(i).IsLayout Then
If doc.Blocks.Item(i).layout.Name Like "11X17*" Then
Set xrTB = doc.Blocks.Item(i).AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False) 'Insert Tb
End If
End If
Next i
0 Likes
230 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Well, I would call it a bug. I think you are going to have to activate each
layout, or try it in .NET.

--
R. Robert Bell


wrote in message news:5451839@discussion.autodesk.com...
Howdy everyone!

Wanted to drop somethin' by you all.. see if anyone had an idea for a better
(faster) implementation. I am inserting xref title-blocks into several
tabs.. it is particularly slow because the app has to activate each tab in
order to add the xref. So I thought "hey! what if I just dropped them into
each layout from the block collection! Then I wouldn't have to activate the
tab, thus increasing speed significantly!"

The problem is... well, it doesn't work. It will only add the xref to an
active layout, even if I call the attachexternalreference function from a
particular inactive layout object.

Any ideas? Suggestions?

Original Working Code:
For Each layout In doc.layouts
If layout.Name Like "11X17*" Then
doc.SetVariable "CTAB", layout.Name 'Activate tab
Set xrTB = doc.PaperSpace.AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False)
End If
Next layout

New, not working code:
For i = 0 To doc.Blocks.count - 1
If doc.Blocks.Item(i).IsLayout Then
If doc.Blocks.Item(i).layout.Name Like "11X17*" Then
Set xrTB =
doc.Blocks.Item(i).AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False) 'Insert Tb
End If
End If
Next i
0 Likes