Display full version of the post: Hi, help pls, how to extract. with Lisp, the NAME

dukeNukem
03.07.2023, 03:32
Hi, help pls, how to extract. with Lisp, the NAME of the
file of an XREF, but that is inside another XREF
For example, the main XREF, the one displayed on the screen, is called ONE, but
within the ONE file, there was already an XREF, within ONE, called TWO.
I need to extract that Xref name (TWO) to a variable.
Please.
And thanks a lot for the help guys !!!!

Kent Cooper
03.07.2023, 19:37
By what method?  If you mean to select the nested Xref, and if you can select it on something that is not a complex object [such as a Dimension or a further-nested element], then this should do it:(cdr (assoc 2 (entget (car (last (nentsel "\nSelect basic object at top level in nested Xref: "))))))The return from (nentsel) for a nested object ends with a list of what it's nested in, starting with the deepest-nested one and stepping up from there.  So if [for example] you pick on a part of a Block in that Xref, you'll get the file name and Block name in "TWO|test" form, not just the Xref drawing file name -- maybe that would serve your purpose.  But if you pick on a Dimension, you'll get something like "*D|REF6", which presumably would not.


Kent Cooper2023-07-03 19:44:05