Author Topic: Nested Layer Name  (Read 2542 times)

0 Members and 1 Guest are viewing this topic.

Serge J. Gianolla

  • Guest
Nested Layer Name
« on: August 27, 2007, 09:57:46 PM »
Am having brain fart!
Is there a way to get the layer and name of the xref nesting it globally via nentsel?

mkweaver

  • Bull Frog
  • Posts: 352
Re: Nested Layer Name
« Reply #1 on: August 28, 2007, 12:02:24 AM »
Am having brain fart!
Is there a way to get the layer and name of the xref nesting it globally via nentsel?

The last item in the list returned by nentsel is a list of the entities involved in the nesting.  Each one will have it's own layer.

Mike

Serge J. Gianolla

  • Guest
Re: Nested Layer Name
« Reply #2 on: August 28, 2007, 01:04:26 AM »
Thanx Mike, I think I may not have been clear. I can get layer name of a nested object no probs, but I want to get the XREF they belong to!

FengK

  • Guest
Re: Nested Layer Name
« Reply #3 on: August 28, 2007, 02:54:15 AM »
i think Mike did answer your question. examine the returned list from nentsel function.

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Nested Layer Name
« Reply #4 on: August 28, 2007, 10:55:03 AM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Serge J. Gianolla

  • Guest
Re: Nested Layer Name
« Reply #5 on: August 28, 2007, 05:41:01 PM »
Lemme have another crack at it! While nentsel returns what I need it is only working on object user selects on screen and only 1 unfortunately and I am interested in globally. My question is, can we make nentsel retrieve info of say 10 or all objects in drawing? Can I get nentsel to work on a selection set (ssget)? Or is there another way to retrieve objects info on format like "C:\Path\XrefName|LayerName"?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Nested Layer Name
« Reply #6 on: August 28, 2007, 06:06:37 PM »
Serge,
This may give you some ideas

Quote

(setq ent  (entsel "\nSelect Xref"))
(<Entity name: 7efbfa10> (10830.5 10069.1 0.0))

(setq nent(nentsel "\nSelect Nested Entity"))
(<entity name:7ecb62f0>
         (10910.7 10416.3 0.0)
         ((1.0 0.0 0.0) (0.0 1.0 0.0) (0.0 0.0 1.0) (11097.9 7210.96 0.0))
         (<entity name: 7efbfa10>)
)


This is for a nested xref ..
Quote
(setq ent  (entsel "\nSelect Xref"))
(<Entity name: 7efbf850> (6740.17 9454.7 0.0))

(setq nent(nentsel "\nSelect Nested Entity"))

(<entity name: 7ec86378>
         (6713.44 9427.98 0.0)
         ((2.0 0.0 0.0) (0.0 2.0 0.0) (0.0 0.0 2.0) (7119.75 9639.48 0.0))
         (<entity name: 7ec86440> <entity name: 7ec86458> <entity name: 7efbf850>)
)

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Serge J. Gianolla

  • Guest
Re: Nested Layer Name
« Reply #7 on: August 28, 2007, 06:49:18 PM »
Thanx Kerry. The thing is I have a guy at work with routine below which adds hyperlink and in HLtip displays layer name just by pointing device on object. But when you have exist. drawing with say 20 xrefs, I do not want to open each individual file to run lisp file, therefore my attempt to get object info such as xref as well as layer name.

Code: [Select]
;HL.lsp Adds hyperlinks to entities based on their layer. 22/10/03 Alex Taylor-Innes, CAD & IT Services
(defun c:HL (/ ss I la)
(setvar "cmdecho" 0)
(princ "\nSelect Entities to add Hyperlinks derived from their layers:")
  (setq ss (ssget))
  (setq I 0)
    (while (< I (sslength ss))
    (setq ent (entget (ssname ss I)))
    (setq la (cdr (assoc 8 ent)))
    (command "-hyperlink" "insert" "object" (ssname ss I) "" "" " " la)
(setq I (1+ I))
)
(setvar "cmdecho" 1)(princ)
)