Jump to content

Select all points on polyline


Kevin Malone

Recommended Posts

Hello, 

 

is there any way to select all points plotted on polyline vertices? Polyline is created by connecting points, now I need to select those points

Link to comment
Share on other sites

The first thing that comes to mind is using the polyline as a fence. Anything that touches the polyline goes into the selection set. If you catch anything besides the points, use Quick Select to narrow it down to points only.

Link to comment
Share on other sites

Sorry, I don't use fence, thought you could specify an object.

 

Can you create a group for the points before you draw the polyline? That way you can select one and get them all.

 

It would help to know more about what you're trying to accomplish, what constraints you have, etc.

Link to comment
Share on other sites

If you have a pline made from pick points then just use the vertices co-ordinates. Replace (car plent) with (entlast)

 

(setq plent (entsel "\nPick rectang"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))
(princ co-ord)

 

 

Link to comment
Share on other sites

BIGAL, 

 

thank you for your reply. This lisp would just retrieve XY coordinates from polyline vertices, however these points are created using some custom AutoCAD extension for Survey and each one holds more information (height, name, datetime..).

point.dwg

Link to comment
Share on other sites

This is possibly what you want if the points are CIV3D cogo points

 

(setq ss (ssget "F" co-ord (list (cons 0 "Aecc_Cogo_point"))))

 

The dwg only has 1 Autocad point post a real CIV3D dwg and can explain more 

Link to comment
Share on other sites

tombu, 

 

thank you for your reply. This tool will select all objects touching polyline, and I have more objects in dwg other then points. I need some kind of a tool that would make selection like: select all objects of this type whose geometry falls entirely within selected objects geometry. 

 

Bigal, 

 

this point I have attached is not COGO point from C3D, it's point created with custom extension (developed by company specialized for planning and surveying) and it is a classic AutoCAD point, but also (I don know how) it contains additional information.

 

Right now, I'm trying to find a way to select points using GIS tools (which is fairly easy) without loosing information during dwg to GIS transformation.

Link to comment
Share on other sites

1. Xdata is information attached to an object, the "POINT" may have Xdata attached to it, in the sample dwg the point does not have any XDATA. 

 

2. OD data is similar generally from GIS type of creation.

 

(defun odtest ()
(setq ent (car (entsel "\n Select point: ")))
(setq odname (ade_odgettables ent))
(if (= odname nil )(alert "no OD objects")(alert "OD objects found"))
)
(odtest)

 

Again returned no extra data. If it works for you post a dwg with correct points.

Edited by BIGAL
Link to comment
Share on other sites

6 hours ago, BIGAL said:

in the sample dwg the point does not have any XDATA

That is not correct:

(
  (-1 . <Entity name: 26190870>)
  (0 . "POINT")
  (5 . "B95")
  (330 . <Entity name: 25db68a0>)
  (100 . "AcDbEntity")
  (67 . 0)
  (410 . "Model")
  (8 . "PTO_02DET_TACKE_")
  (370 . -1)
  (100 . "AcDbPoint")
  (10 6396532.30206604 4982796.09996944 0.0)
  (210 0.0 0.0 1.0)
  (50 . 0.0)
  (
    -3
    (
      "SURVEY"
      (1002 . "{")
      (1000 . "#VU=20111213.0717")
      (1000 . "#H=132.320")
      (1000 . "N=3")
      (1000 . "#T=7")
      (1002 . "}")
    )
  )
)

 

Link to comment
Share on other sites

Roy, 

 

that's right. Those are exact information from attached point. That is information I would lose if I transfer entire dwg into GIS software, create selection and then export selection into new dwg.

 

5 hours ago, tombu said:

So to select all the points in the drawing with "SURVEY" xdata.


(sssetfirst nil (ssget "X" '((0 . "POINT")(-3 ("SURVEY")))))

 

This will select all points containing this XDATA, but I need subset of them, only the one that are placed on (vertices) polyline.

Link to comment
Share on other sites

Thanks roy_043 I was not drilling down enough. 

 

For Kevin go back to my post about get co-ordinates then can compare the point XYZ with the co-ordinates of the pline.

Link to comment
Share on other sites

BIGAL, 

 

if you are referring to

On 7/20/2021 at 2:55 AM, BIGAL said:

If you have a pline made from pick points then just use the vertices co-ordinates. Replace (car plent) with (entlast)

 


(setq plent (entsel "\nPick rectang"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))
(princ co-ord)

 

 

 

It only prints out vertex coordinates, doesn't make any selection. 

 

Side question: how to list XDATA from object, and also how to create point with this XDATA?

 

Link to comment
Share on other sites

1 hour ago, Kevin Malone said:

It only prints out vertex coordinates, doesn't make any selection.

 

That is correct. a polyline doesn't have any "points" on it to select.  but if you want to create points off the polyline's vertices use the following.

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-comman-to-create-points/m-p/6287548/highlight/true#M340839

 

Quote

how to list XDATA from object, and also how to create point with this XDATA?

 

https://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php

This explains more about xdata

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...