CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 8588
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Hi, help pls, how to extract. with Lisp, the NAME

 Post Reply Post Reply
Author
dukeNukem View Drop Down
Newbie
Newbie


Joined: 03.Jul.2023
Location: Costa Rica
Using: Autocad 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote dukeNukem Quote  Post ReplyReply Direct Link To This Post Topic: Hi, help pls, how to extract. with Lisp, the NAME
    Posted: 03.Jul.2023 at 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 !!!!

Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 629
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kent Cooper Quote  Post ReplyReply Direct Link To This Post Posted: 03.Jul.2023 at 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.


Edited by Kent Cooper - 03.Jul.2023 at 19:44
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,322 seconds.