Results 1 to 2 of 2

Thread: Merge 2 blocks based on common insertionpoint

  1. #1
    100 Club
    Join Date
    2007-07
    Posts
    104
    Login to Give a bone
    0

    Default Merge 2 blocks based on common insertionpoint

    Hi to anyone interested / willing to get involved

    The case:
    We have a large amount of files, in wich a large amount of blocks (sirens, no attributes in this block) are placed on others blocks (detectors, these have attributes). The have the same insertionpoint. These blocks will be read into a central controlling system, and should be displayed as 1 pictogram. For this to be possible, the two overlapping blocks need to become 1 block.

    Solution so far:
    So far I am able to gather all block-coordinates (insertionpoints as strings) that occur more than once in the drawing. With these coordinates I want to find the double blocks and merge the elements of the "siren" as part of the "detector" block.

    Code:
     
    If CoordCnt > 1 Then
        'StrArray(LoopCnt) is the coordinate string, CoordCnt is the counter
        MsgBox strArray(LoopCnt) & " occurs " & CoordCnt & " times"
        MsgBox BlkObj.Name 'only gives me 1 name
    End If
    Question:
    I need to find both blocks based on the coordinate. Two coordinates are found where the blocks are double, but I only get 1 blockname using the above code. I've been trying some thing, like "for all blocks in thisdrawing if insertionpoint = strarray(Loopcnt) then" but somehow I keep getting 1 blockname only. Any ideas?

    PS. I'm using Firefox, I didn't see the Prefix: drop-down list, which should have been just above the Title text box. I'm using AutoCAD 2005.

  2. #2
    100 Club
    Join Date
    2007-07
    Posts
    104
    Login to Give a bone
    0

    Default Re: Merge 2 blocks based on common insertionpoint

    I solved this issue by passing the values in "strArray(LoopCnt)" and "CoordCnt" into a separate module seperatly.
    XYcoord = strArray(LoopCnt)
    PointCount = CoordCnt
    In the second modules I did a "For each" loop that compares the double values found to the existant values, and gives the blocknames as it bumps into them. That worked nicely. Thanks to anyone who bothered reading this post and spending a moment to think about the solution.

Similar Threads

  1. Replies: 2
    Last Post: 2013-08-16, 02:57 PM
  2. Replies: 4
    Last Post: 2009-09-30, 05:29 PM
  3. Rename or Merge Duplicate Blocks
    By jamie_winkler in forum CAD Management - General
    Replies: 2
    Last Post: 2009-04-29, 02:29 PM
  4. Replies: 2
    Last Post: 2008-10-27, 01:44 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
  •