PDA

View Full Version : Get an existing reference


JAM
23-05-2005, 11:05 AM
Hi!
I am wondering how to assign a AcadBlockReference variable value to the existing BlockReference object on the drawing. I have the BlockReference object on the drawing named "Corner-Stamp_2".

Sub ATTRIB()
Dim MyBlock As AcadBlock
Dim MyBlocks As AcadBlocks
Dim MyBlockReference As AcadBlockReference
Dim Atts As Variant

Set MyBlocks = ThisDrawing.Blocks
Set MyBlock = MyBlocks.Item("Corner_Stamp_2")

'???????????????????????????????????
'Set MyBlockReference = ???????
'Atts = MyBlockReference.GetAttributes
'will write them to database later
'???????????????????????????????????


End Sub

TCARPENTER
23-05-2005, 02:08 PM
Hi JAM,

You'll need to make use of selection sets to do this. I've two faq's over on tek tips that show some of the ins and outs of this. Take a look and see if they help at all, (they may a bit advanced) so if they don't, post back.

Easier selection set creation in VB/VBA: http://www.tek-tips.com/faqs.cfm?fid=5792
How to connect AutoCAD to Access: http://www.tek-tips.com/faqs.cfm?fid=5792

HTH
Todd