I just read an article in AUGIWORLD about combining AutoLisp & Fields. Does anyone know of a way to use a field to show the x-refs attached to a dwg?
Thanks,
Chris
|
I just read an article in AUGIWORLD about combining AutoLisp & Fields. Does anyone know of a way to use a field to show the x-refs attached to a dwg?
Thanks,
Chris
No, but this is one thing that the old RTEXT can still do.
Example: $(xrefs,3)
See the ET help file (\Express\acet.chm) for more details.
R.K. McSwain | CAD Panacea |
I don't know about fields, but I do know how to get a list of xrefs.
Called like (for current drawing)Code:(defun XrefList (Doc / Lst) (vlax-for Blk (vla-get-Blocks Doc) (if (equal (vla-get-IsXref Blk) :vlax-true) (setq Lst (cons (vla-get-Name Blk) Lst)) ) ) Lst )
Must have loadedCode:(XrefList (vla-get-ActiveDocument (vlax-get-Acad-Object)))
into the drawing at least once before you can use this.Code:(vl-load-com)
I bet he was inquiring about using a FIELD because he wants a string that updates automatically. Although RTEXT has it's other limitations, it does update automatically, compared to having to run the lisp code each time.
R.K. McSwain | CAD Panacea |
Correct. In the meantime will have to look into RTEXT. Thanks for the help.
You could use reactors then once the text in the drawing, to update it. Just another idea.
I can't figure out why this isn't working:
MTEXT. Insert field. Add Diesel Expression (or something like that). I type $(xrefs,2). Ok.
The result is $(XREFS)??
I tried saving the dwg. I closed & reopened the dwg. I had one x-ref already in the dwg, but I added a couple more just in case, but the field doesn't show the x-refs.
Can anyone tell what I'm doing wrong?
Thanks a lot.
Please re-read my original reply.Originally Posted by crohloff.72988
$(xrefs,2) is not a DIESEL string and it doesn't work in a FIELD.
That is special syntax that only RTEXT recognizes.
See the ET help file (\Express\acet.chm) for more details.
R.K. McSwain | CAD Panacea |
Thanks RK. What was throwing me off is that in ET Help it does refer to $(xrefs) as a DIESEL function. However, for another function, $(getprop), it says it is supported only in RText objects. Apparently the same is true for $(xrefs).
there seems to be a limit on the number of characters rtext will dislplay... so be aware not all of your xrefs may display, i ended deleting this part of our tag because of that