I am using dynamic block with attribute to tag some other dynamic blocks.
Since content of the attribute might vary, the box surrounding the attribute must follow attribute's boundary.
Width of the box is controlled with a linear parameter inside the dynamic block.
I am trying to create a reactor that will automatically change linear parameter of the dynamic block whenever attribute is modified.
In fact I already created that reactor. I am using vla-getBoundingBox to get width of the attribute, and everything is OK until block has no rotation.
As you know, whenever block is rotated vla-getBoundingBox will return block's boundary in World coordinates, which will lead to a wrong result for me.
I know a few tricks that helped me before.
For example, when I am inserting a new block with some rotation I can rotate it to 0 deg. value, run vla-getBoundingBox, and then rotate the block back on it's place. I use vlax-put function for that. However, it appears that vlax-put does not work when I try to use it in my object reactor...
I tried couple functions as alternatives to vla-getBoundingBox that should return Bounding Box in any UCS, but again none of them worked in my reactor.
Can anybody tell me how to make vlax-put work in my reactor or is there any other way to solve the issue? Are reactors limiting functions that we can use?
Following lines in my "UpdateTagField" reactor are now commented, so the rest of the code can work. However, that means that reactor will apply wrong bounding box size to any block that has rotation properties different from 0. Please remove comments if you try to test it.
;(setq rot (vlax-get-property (nth 0 objlist) 'Rotation))
;(vlax-put (nth 1 objlist) 'Rotation 0)
(vla-getBoundingBox (nth 1 objlist) 'a 'b)
;(vlax-put (nth 1 objlist) 'Rotation rot)
Full code and an dwg file with blocks are attached.
I would appreciate your advises.