- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
the workflow of a certain very frequently used design involves using the measure-command and mirroring a set of dynamic blocks. After the design is finished some dynamic block attribute values are extracted (dataextraction) and delivered to the customer.
The first problem is that the dynamic block [MYBLOCK] we are using has a custom rotation attribute [R1]. The block has many more custom attributes/properties as well as normal attributes. When the block is inserted with measure (with alignment to the measure path enabled) the block is rotated [R2]. When this is done the block appears correctly inserted, but the R1 value is still 0 when it should be R2 and R2 should be 0. This leads to incorrect values in the dataextraction table even though everything looks ok.
Correcting the block rotation to 0 was fairly easy but how do I use c# to edit a specific dynamic block attribute?
The second problem is that when the blocks are mirrored their scales change. What is the command to set a blocks scale? Should I use transform methods (scale with the inverse value of the block scale)? autodesk transform
I've come so far that I have a ObjectIdCollection with all the block ID's that need to be checked for and here is what should be done (somewhat simplified)
- R2 != 0?
- True: set rotation to 0, set R1=R1+R2
- False: do nothing
- scale x !=1?
- True: set scale to 1, adjust R1
- False: do nothing
- scale y !=1?
- True: set scale to 1, adjust R1
- False: do nothing
I am aware that we could use more sophisticated and not so error prone methods to achieve what I described, but solving this with coding is also educational for me. All pointers are greatly appreciated!
- F
PS. First timer here, so please be very detailed in your answers 😃
Solved! Go to Solution.