Hi,
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?
Thanks
![]() |
|
![]() |
|
![]() |
|
![]() |
Hi,
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?
Thanks
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:
https://drive-cad-with-code.blogspot...h-drawjig.html
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.