how to retrieve a block name from autocad to vba

Discussion in 'AutoCAD' started by kamalesh, Jun 12, 2004.

  1. kamalesh

    kamalesh Guest

    Hi Gentlemen,

    I developing a wizard, in that i have to retrieve the block names that are used in an AutoCAD drawing and all of them are to be displayed in a MSHflexgrid. Here my doubt is how
    to retrieve the block names from the drawing to VBA.

    Can any help me in this regard..

    Thanx in advance,
    Kamalesh
     
    kamalesh, Jun 12, 2004
    #1
  2. Kamalesh -

    First off, you cannot use the MSHflexgrid control if this is a VBA app - it
    is against your Microsoft EULA. Search the ng for a thread regarding grid
    controls earlier this week. In it I gave a few freeware ones to try.

    As for the blocks:

    Dim oBlk As AcadBlock
    For Each oBlk In ThisDrawing.Blocks
    Debug.Print oBlk.Name
    Next

    This will give you all blocks in the drawing's block table.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Jun 12, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.