dilan Posted July 19, 2019 Posted July 19, 2019 Hello to all. I have a list of points: ((76712.0 53577.0 749.001) (76666.0 53517.8 746.341) (76612.1 53448.2 744.644) (76590.7 53336.1 752.25) (76534.9 53273.7 750.654)) Is it possible to add it to the <Selection set> ? As if I selected these points as a function ssget. I know about the function ssadd, but I do not understand how to apply it... Trying to do something like this: (setq ptlist ((76712.0 53577.0 749.001) (76666.0 53517.8 746.341) (76612.1 53448.2 744.644) (76590.7 53336.1 752.25) (76534.9 53273.7 750.654))) (foreach item ptlist (setq set_sa (ssadd item)) ) And I get nil I'm doing something wrong. Help me please... thank Quote
dilan Posted July 20, 2019 Author Posted July 20, 2019 Another way These points are in my layer "Points" I'm trying to add them to the set: (ssget "_I" '((0 . "POINT") (8 . "Points"))) but i get nil Quote
BIGAL Posted July 20, 2019 Posted July 20, 2019 (edited) 1st up a selection set is objects and a point is a property of an object. If you want objects at a point you can do it (ssget pt) using a point is valid. Then you can use ssadd. But point must be on object. You will need to repeat for every point in your list. Edited July 20, 2019 by BIGAL Quote
dilan Posted July 20, 2019 Author Posted July 20, 2019 I went the other way, I added my points to the set like this: (setq set_sa (ssget "_X" '((0 . "POINT") (8 . "POINTS")))) I have points in the drawing, I received a list of their coordinates and thought how to add these points to the set programmatically, without a choice in the drawing. The way I wrote above seems to work for me. I do not need to create a list of coordinates of points, I just select them as a filter. Quote
BIGAL Posted July 21, 2019 Posted July 21, 2019 (edited) You still have a selection set of "OBJECTS" which just happen to be Autocad "Points" and again a property is the layer dxf 8 the co-ords are dxf 10. You can have multiple filters. eg Text Layer Color Textheight. Like wise (setq set_sa (ssget "_X" '((8 . "POINTS")))) would work if "points" were the only thing on layer "Points" Edited July 21, 2019 by BIGAL Quote
lee50310 Posted July 26, 2019 Posted July 26, 2019 Try this code (defun c:test() (setq ptlist '((76712.0 53577.0 749.001) (76666.0 53517.8 746.341) (76612.1 53448.2 744.644) (76590.7 53336.1 752.25) (76534.9 53273.7 750.654))) (foreach x ptlist (setq e (entmakex (list '(0 . "POINT") '(100 . "AcDbEntity") '(410 . "Model") '(100 . "AcDbPoint") '(210 0.0 0.0 1.0) '(50 . 0.0) (cons 10 x) ) ) ) (setq set_sa (ssadd e)) ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.