Lesson53 – Accessing Subentities without User Input

While (nentsel) is very useful in accessing subentities, it does have the drawback of requiring user input. For instances in which the point selecting the subentity is already defined, the (nentselp) function is provided.

Explanation: the (nentselp) function

Command: (nentselp [prompt] point )
((<Entity name: 60000093>) (10.50000 11.43533
0.0))

(nentselp) returns the same lists as (nentsel). When a PLINE is selected, it returns a two-element list similar to the one shown above. When a subentity of a BLOCK is selected, (nentselp) returns the same seven- element list as that returned by (nentsel).

PRACTICE

In this practice you will use (nentselp) to extract the vertex of a polyline. Estimated time for completion: 5 minutes.

1. Define a point using (setq PT1 (getpoint “\nPick: “)).

2. Start the PLINE command, pick a few points, then enter !PT1 for one

of the points. End the PLINE command.

3. Extract the vertex at PT1 by typing in: (setq V1 (nentselp PT1)).

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons
SUBSCRIBE TO OUR NEWSLETTER

It's FREE!

Sign up and receive an email every time a new tutorial is published