- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to select the last entity drawn, which will always be a polyline in the routine, and get the direction of the first segment. Below is a two segment poly, and as you can see there are 3 (assoc 10) coordinates.
((-1 . <Entity name: 32edbe0>) (0 . "LWPOLYLINE") (5 . "25D4") (330 . <Entity name: 4814be80>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "NOTES") (100 . "AcDbPolyline") (90 . 3) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 4699.0 5099.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 4760.xxx-xxxxxxxx 5074.xxx-xxxxxxxx) (40 . 0.0) (41 . 0.0) (42 . 0.153731169572485) (91 . 0) (10 4802.xxx-xxxxxxxx 5070.xxx-xxxxxxxx) (40 . 0.0) (41 . 0.0) (42 . 3.99931167657414) (91 . 0) (210 0.0 0.0 1.0))
(EDIT...
I don't know why all those "xxxx" showed up. Those are just regular coordinate numbers on my screen, for some reason the cut/paste isn't translating.)
I'd like to get the first and second points ... I've got this so far...
(setq Line1 (entlast))
(setq P1 (cdr (assoc 10 (entget Line1))))
>>How do I get P2 since they are both "assoc 10" in the list? <<
(setq Dir1 (angle P1 P2))
Thanks for the help.
Solved! Go to Solution.