When 2d point equal 3d point?

When 2d point equal 3d point?

Kirillspec
Contributor Contributor
597 Views
5 Replies
Message 1 of 6

When 2d point equal 3d point?

Kirillspec
Contributor
Contributor

I have a code in which first i get lwpolyline from drawing

(setq pl (entget (car (entsel)))

then i get endpoint of this lwpolyline

(setq plbbb (cdr (assoc 10 (reverse pl))))

then i have in my drawing block with insertion point at the end of my polyline, and i want to obtain a selection set with this block only

(setq ssblock (ssget "_X" (list  (cons 10 plbbb) (cons 0 "INSERT"))))

The question is - why this ssget function is worked and gives me a selection set with this block although end point of lwpolyline is 2d (without z) and insertion point of block is 3d (with z = 0). ?

If i want compare endpoint of lwpolyline and insertion point of block, the =, eq and equal returns nil

 

0 Likes
Accepted solutions (1)
598 Views
5 Replies
Replies (5)
Message 2 of 6

TomBeauford
Advisor
Advisor

lwpolyline has an Elevation value in properties. It's constant for every vertex lwpolyline unlike a 3dpolyline but it has Elevation.

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes
Message 3 of 6

Kirillspec
Contributor
Contributor

Yes, but the question is why filter (cons 10 plbbb) where plbbb has only x and y coordinates works for block with insertion point which has x,y and z coordinates?

0 Likes
Message 4 of 6

ВeekeeCZ
Consultant
Consultant
Accepted solution

I think that where the point definition is required and a 2D point is accepted, then it is implicitly assumed that the omitted Z is 0.

 

While we don't see into the ssget definition.... it could be similar as

(entmakex (list (cons 0 "CIRCLE") (cons 10 '(0 0)) (cons 40 4))))

0 Likes
Message 5 of 6

Kirillspec
Contributor
Contributor

OK, Thank you!

0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

If you want 1 block dont worry about "X", (ssget pt)  I have found reliable

0 Likes