See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: Attach Line to Block

  1. #1
    Join Date
    Login to Give a bone

    Default Attach Line to Block


    I have created a line with the points as the insertion points of two blocks. Is it possible to keep the line points to be the insertion points of blocks when the blocks are moved?


  2. #2
    Join Date
    Login to Give a bone

    Default Re: Attach Line to Block

    There could be a few different ways to do it with .NET API, as programmatic solution:

    1. You can handle Database.ObjectModified event, where you need to identify if the modified entity is either the said line, or the said block reference. After that, you can change the other one accordingly to maintain the connection. Obviously, this is a "after-fact" change when one party of the 2 connected parties has been changed

    2. You can use Overrule (ObjectOverrule or TransformOverrule) to force the association (i.e. when one changes, the other one changes automatically).

    3. You can create a custom command that is only used to move these lined 2 entities (maybe, only is used for moving the block). See this article of mine:


    In order to identify the lined pair, you need some way to know which 2 entities are linked. Likely, you would embed XData to each pair.

    Besides the aforementioned 3 ways, you may also try to use Constraints, sparing you from code solution (there is also API for Constraints, known as AssocNetwork...). The techniques I mentioned here are all quite advanced AutoCAD .NET API topics. You need to be fairly good at AutoCAD .NET API programming to tackle it.

Similar Threads

  1. 2017: Grading surface tries to attach to an alignment line when grading done first, why? How to fix?
    By tadthurston725387 in forum AutoCAD Civil 3D - General
    Replies: 2
    Last Post: 2018-07-19, 05:46 PM
  2. Attach xdata to 3DSolid in block
    By pigidy in forum AutoLISP
    Replies: 6
    Last Post: 2016-05-25, 08:39 PM
  3. 2010: making all line segmentsof same line type show as one line segment
    By Darren Allen in forum AutoCAD LT - General
    Replies: 5
    Last Post: 2015-09-02, 10:35 PM
  4. Add functionality similar to LDTs "Attach Multiple" line/curve command.
    By civil3d.wishlist1941 in forum Civil 3D Wish List
    Replies: 0
    Last Post: 2010-10-06, 01:59 AM
  5. line extends THROUGH line to another line in the drawing
    By mhudson in forum AutoCAD General
    Replies: 11
    Last Post: 2006-01-20, 09:09 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