![]() When the text is copied, delete the resulting orphaned text object when the line is copied, create a corresponding text object and build the association between the copied line & new text object. (vlr-owner-add tbox:tboxreactor (vlax-ename->vla-object box))Īnd the methods I have described above is the approach that I would recommend for your scenario: (if (= 'vlr-object-reactor (type tbox:tboxreactor)) I then remove this temporary Command Reactor within any of its own callback functions so as to prevent the propagation of redundant reactors in the drawing: (defun tbox:tboxcopiedcommandended ( reactor params / ent ) (vlr-command-reactor "tbox-tboxcopiedcommreactor" (setq tbox:owner (append tbox:owner (list (car params)))) However, the most important point that you have to remember when working with object reactors is that you cannot modify the owner of an object reactor within its own callback function.Īs such, for all modification events in which I need to modify the owner of the event, I generate a temporary Command Reactor which will fire after the object has been modified, so as to ensure that the object is not locked for modification.įor example, for the textbox copy event, I use the following: (defun tbox:tboxcopied ( owner reactor params ) When the Copy event for the texbox is fired (evaluating the tbox:tboxcopied callback function), I decide that a textbox cannot live without the text it encloses, and so I delete the orphan textbox from the drawing. Similar to your setup, these are built & configured on program load using Extended Entity Data (xData) attached to both the text and textbox. (vlr-object-reactor box "tbox-tboxreactor" In my application, I use a separate Object Reactor to handle the modification events for the text object and textbox respectively: (vlr-object-reactor txt "tbox-textreactor" This is the approach that I followed when developing my Associative Textbox application (which is essentially solving the same problem of associating two objects in a drawing - in my case, a text object and a bounding frame). Whereas, if the line is copied into empty space, you might decide to replicate the associated text object and position it relative to the new line. ![]() Since the two objects are linked, you may need to decide which object is the 'master' and which is the 'slave'.įor example, if the text object is copied into empty space, you might decide that the resulting copy should be deleted, since there is no line to which it could refer. I thought the vlr-copied reactor could solve my problem but since I am not very proficient with reactors I cant seem to make it work.Ĭould someone point me to the right direction? I found thisīut I cannot understand when I make a selection set of lines but also including non relevant other entities, how to pass the correct selection set to the reactor and get the handles updated.įirstly, you need to decide on the behaviour that you want the objects to exhibit assuming that either object (text or line) is copied independently of the other. The problem arises when I copy the line with the texts where each one gets a new handle but the stored xdata are giving the old handles which leads to further problems. For that I have stored the handle of the line to each text as xdata and vice versa, e.g. Older works officially available for free in MP3 and FLAC format on their bandcamp: https. It was originally named VULPvibe Records and is currently used in conjunction with the Halley Labs label name. ![]() Through some lisp routines, if the data of the line change, the text entities reflect the change by changing their text. Profile: Electronic music label of Canadian electronic music producer, game developer and graphic designer, Renard (3). Because the texts represent some data of the line they are always considered children of the line and visible next to it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |