- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello guys
I made this routine (with a lot of learning from this forum) to create a field to link two attributes.
(defun c:CreateField ( / nsel ent objid nsel2) (setq nsel1 (nentsel "\nSelect the origin block")) (setq ent (entget (car nsel1))) (setq objid (vla-get-ObjectId (vlax-ename->vla-object (car nsel1)))) (setq nsel2 (car (nentsel "\nSelect the destination block"))) (vla-put-textstring (vlax-ename->vla-object nsel2) (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).TextString>%") ) (command "regen") (princ) )
Lets say I have a block named TITLE, with two attributes named HEAD and TAIL. Just for information, in the HEAD I put a letter and in the TAIL I put a number.
In a drawing, I have two or more insertions of this block. Using my routine above, I create a field to link HEAD from the first block to HEAD from the second block. After this, I repeat the operation in the same way to create a link between TAIL to TAIL.
Now I am wondering, and here it comes the tricky question...Is it possible to select only one attribute to create both links? I mean, how can I get the ObjectID of two objects, If I select only one?
Thanks,
Marcelo
Solved! Go to Solution.