Results 1 to 5 of 5

Thread: Get composition of a object block without exploding it

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2005-04
    Posts
    1
    Login to Give a bone
    0

    Default Get composition of a object block without exploding it

    Hello,

    To know what's in a block, I'm using

    exploded=object.explode ' explode a block
    explodedObjects = object.Explode
    For i = 0 To UBound(explodedObjects)
    Prompt explodedObjects(i).ObjectName

    Select Case explodedObjects(i).ObjectName
    Case "AcDb2dPolyline"
    '...
    end select
    end for

    Is there a possibility without exploding ?

    Deniz

  2. #2
    100 Club RobertAitken's Avatar
    Join Date
    2000-10
    Location
    Sunny Scotland
    Posts
    148
    Login to Give a bone
    0

    Default Re: Get composition of a object block without exploding it

    Quote Originally Posted by d.cakmur
    Hello,
    .....
    Is there a possibility without exploding ?

    Deniz
    Sorry for the this answer but it's been awhile.

    Short answer Yes you can.

    It's more to do with the block reference than the block object itself. This is where Ed and RRB correct me.

    You can iterate through the block references and blocks and change them without exploding. I don't have any code to had that would show you. But it is possible.

    You can for instance change the colours of entities with blockreferences and blocks programatically.

    I know it's not much help but it might set you in the right direction.

    Robert Aitken

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Get composition of a object block without exploding it

    Quote Originally Posted by robert.3.aitken
    Short answer Yes you can.

    It's more to do with the block reference than the block object itself. This is where Ed and RRB correct me.
    <snort>

    To gat at the objects in the block, you simply need to iterate thru the Block object in the Blocks collection.
    Code:
    Dim myBlock as AcadBlock
    Set myBlock = ThisDrawing.Blocks.Item("MySample")
    
    Dim anEntity as AcadEntity
    For Each anEntity in myBlock
      'working code here
    Next anEntity

  4. #4
    100 Club RobertAitken's Avatar
    Join Date
    2000-10
    Location
    Sunny Scotland
    Posts
    148
    Login to Give a bone
    0

    Default Re: Get composition of a object block without exploding it

    Quote Originally Posted by RobertB
    <snort>

    To gat at the objects in the block, you simply need to iterate thru the Block object in the Blocks collection.
    Code:
    Dim myBlock as AcadBlock
    Set myBlock = ThisDrawing.Blocks.Item("MySample")
     
    Dim anEntity as AcadEntity
    For Each anEntity in myBlock
    'working code here
    Next anEntity
    See, I knew it was something simple

    Robert

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,463
    Login to Give a bone
    0

    Default Re: Get composition of a object block without exploding it

    PS, once you have the AcadBlock object, it has an Items property that returns the block's objects.
    C:> ED WORKING....


    LinkedIn

Similar Threads

  1. Allow block exploding
    By chadwickt in forum AutoCAD General
    Replies: 15
    Last Post: 2012-01-24, 11:14 PM
  2. Insert new block attribute without exploding...
    By jnantel in forum AutoCAD General
    Replies: 3
    Last Post: 2010-01-07, 11:27 PM
  3. Insert dynamic block without exploding
    By curtis.hatfield in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2009-10-26, 04:56 PM
  4. Need help exploding huge block
    By jdrewreed in forum AutoCAD General
    Replies: 10
    Last Post: 2009-07-09, 05:54 PM
  5. Exploding block references
    By mike.83572 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-03-02, 10:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •