Display point markers for geometry

Display point markers for geometry

Anonymous
Not applicable
3,229 Views
13 Replies
Message 1 of 14

Display point markers for geometry

Anonymous
Not applicable

Hello Forum Members,

If I draw a simple geometry, like a rectangle, is it possible to display the points that make up that rectangle with point markers in graphics as can be done with point objects using point marker styles.

0 Likes
3,230 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable

I don't think this is possible because points defining endpoints are not real objects but coordinates.

Message 3 of 14

Anonymous
Not applicable

Thanks a lot AUGIfr for your reply.

As you are saying, point marker styles will not work for other geometry apart from points. This is quite disappointing. But can you think of any alternative way I can display my geometry points in graphics apart from those blue point nodes you get when you click to select an object?

0 Likes
Message 4 of 14

jggerth
Advisor
Advisor

Place a POINT object at the relevant geometry points, and set the PDMODE variable to display as desired.

 

Alternatively, place a BLOCK Instance at the relevant points.

 

 

0 Likes
Message 5 of 14

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... can you think of any alternative way I can display my geometry points in graphics ...?


A routine could certainly be written that would put either a Point entity or a Block [whichever you prefer] at each vertex of all selected Polylines all at once, so you don't need to go around and add them everywhere yourself as JGerth's suggestion implies.  Since your "like a rectangle" is only one of countless possibilities of simple geometry, would you want other kinds of things also marked in that way?  A single routine could, for example, with one User selection of any number of types of objects, put such markers on all Polyline vertices and all Line endpoints and at the centers and perhaps quadrant points if you like of all Circles, and at the centers and endpoints of all Arcs, and at the insertion points of all Blocks and/or Text, and .... 

Kent Cooper, AIA
0 Likes
Message 6 of 14

Anonymous
Not applicable

Well, will something like that suits you? This is just a display style with a jitter setting Off:

 

autocad-2016-crosses-to-intersections.jpg

0 Likes
Message 7 of 14

Anonymous
Not applicable
Sorry guys, for the late reply. Thanks, JGerth, for your suggestion. But as Kent1Cooper pointed out, it will be extremely time-consuming to go creating points from vertex to vertex if one is dealing with a large number of geometry.
Kent1Cooper, could you write me such a routine you were referring to? I have no idea how to do that.
Thanks in advance.
0 Likes
Message 8 of 14

Anonymous
Not applicable
AUGIfr, that's a very good idea. This will work great for many situations (like polygons and certain polylines). But when you have multiple vertex along the straight side of a geometry the technique will fail. It won't also work for circles and arcs.
0 Likes
Message 9 of 14

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
.....
Kent1Cooper, could you write me such a routine you were referring to? I have no idea how to do that.
....

For LWPolylines only so far [since presumably that's what your example of a rectangle would be and you mention vertices in Post 8, but they can be of any shape], in simplest terms, and very lightly tested:

 

(defun C:PPV (/ ss pl v); = Points on Polyline Vertices

  (prompt "\nTo place Points on all vertices of selected Polyline(s),")

  (setq ss (ssget '((0 . "LWPOLYLINE"))))

  (repeat (setq n (sslength ss))

    (setq pl (ssname ss (setq n (1- n))))

    (repeat (setq v (cdr (assoc 90 (entget pl))))

      (command "_.point" (vlax-curve-getPointAtParam pl (setq v (1- v))))

    ); repeat

  ); repeat

); defun

 

The same idea can be extended to handle whatever additional entity types you want, and whatever locations on them you want Points added to.  Provide specifics and they can be included.

 

It doesn't yet do things that it could like check whether you actually picked anything, account for object snap [you'll be okay if it's either off or any running modes include Endpoint], account for non-World Coordinate Systems, set a PDMODE value for visibility of the Points, etc., etc.

Kent Cooper, AIA
0 Likes
Message 10 of 14

Anonymous
Not applicable
Kent1Cooper, I get this:

; error: no function definition: VLAX-CURVE-GETPOINTATPARAM
0 Likes
Message 11 of 14

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
Kent1Cooper, I get this:

; error: no function definition: VLAX-CURVE-GETPOINTATPARAM

That means the VL... functions are not loaded.  I should probably have thought of that, and usually do include the following in fully-developed routines.  Put this in at the Command: line:

 

(vl-load-com)

 

and try again.

Kent Cooper, AIA
Message 12 of 14

Anonymous
Not applicable
Works like a charm, Kent1Cooper! Thanks so much. Now, how do I make it work for other geometry (circles, arcs, polygons....
0 Likes
Message 13 of 14

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
.... Now, how do I make it work for other geometry (circles, arcs, polygons....

It will already do polygons, at least any made with the Polygon command, since what that makes is a Polyline.  If a polygon is made up of separate Lines, that would need to be done by marking the Lines rather than the polygon as a whole.

 

That would not be difficult.  But clarify at what location(s) in relation to specific entity types you would want Points added:

 

LINE:  both end points?  also midpoint?

CIRCLE:  center?  also quadrant points?

ARC:  end points?  center?  midpoint?  any quadrant point(s) that are within the sweep of the Arc?

ELLIPSE:  as with Circle?  if partial, as with Arc?

SPLINE:  endpoints?  any fit or control points?

POLYLINE:  in addition to vertices, perhaps also midpoints of segments such as get grips when selected?
BLOCK:  insertion point?  anything on internal geometry [harder than the preceding possibilities]?

RAY?  XLINE?  etc., etc.....

Things other than geometry per se [TEXT, MTEXT, DIMENSIONS, etc.]?

 

And in the case of things that meet where each one should get a Point [e.g. contiguous Line ends], a "plain" routine would place two [sometimes more] Points.  Should it check whether there's one there already, and add one only if there isn't?

 

In the case of midpoints, for whatever entity types you would want those marked [including Polyline segment midpoints if you choose that option], check out MarkMidPoints.lsp, available here.  Points are just one of the possible markers it can place.

Kent Cooper, AIA
0 Likes
Message 14 of 14

Anonymous
Not applicable

Hello Kent,
Thanks for your detailed inquiry. Here are my answers:
LINE: Both end points.
CIRCLE: Quadrant and center
ARC: End points, center and midpoint
ELLIPSE: As with circle, if partial as with arc
SPLINE: End points and all fit points
POLYLINE: Vertices only
BLOCK: Vertices only (If this will be difficult it can be ignored). Could exploding the block make things simpler, perhaps?
RAY, XLINE: Vertices only (Not too relevant)
OTHER OBJECTS: Vertices only (Not too relevant)
Perhaps a way these points can additionally be turned off if needed will also be useful.
Really appreciate your help so far. Thanks!

0 Likes