What would be an Object after using breakatpoint command ?

What would be an Object after using breakatpoint command ?

Kh.mbkh
Advocate Advocate
429 Views
7 Replies
Message 1 of 8

What would be an Object after using breakatpoint command ?

Kh.mbkh
Advocate
Advocate

Having a pline PL as entity:

(Setq PL (car (entsel)))

After using breakatpoint command at a given point pnt (that belongs certainly to PL), using 

(Command "breakatpoint" PL "" pnt), we have as result two polylines.

The question is which of the 2 polyline is PL ? 

I noticed that this depends on the direction of original PL, but not sure ...

Any idea, thanks!

 

0 Likes
430 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant

Yes, it depends on the direction.  The one that remains under the original entity name will be the one from the original start point up to where you Break it, and the part "downstream" from there will be a new entity name [and (entlast) in AutoLisp, or "Last" if you use that in object selection].

Kent Cooper, AIA
0 Likes
Message 3 of 8

hak_vz
Advisor
Advisor

After the break command is used, old segment of cut polyline retain its handle (group code 5), that is unique to this entity as long as it exist in the drawing. Other segment is last segment in a drawing. If you apply consecutively break  command on many object your conclusion may not work.

 

(defun c:BAPHO ( / handle)
;break at point and return original entity; needs double selection
(setq handle (cdr (assoc 5 (entget(car (entsel "\nSelect polyline >"))))))
(command "_.break" pause "_first" pause "@")
(vla-highlight (vlax-ename->vla-object (handent handle)) 1)
(princ)
)


(defun baproe( / handle)
;break at point and return entity name of original polyline
(setq handle (cdr (assoc 5 (entget(car (entsel "\nSelect polyline >"))))))
(command "_.break" pause "_first" pause "@")
(handent handle)
)

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 4 of 8

Kent1Cooper
Consultant
Consultant

Many people may not be aware that if you give the Break command an entity name without a pick point, it automatically goes into "First" option without that needing to be specified, since it has no point to start the Break from yet.  So for example, in your second function definition, instead of pulling the handle from the entity and then having to pull the entity name back from the handle, you can forget the handle, just use the entity name, which in the Break command reduces the number of times you need to pick on it, and return it at the end:

 

(defun baproe ()
;break at point and return entity name of original polyline
  (setq ent (car (entsel "\nSelect object, then point to Break it at: ")))
  (command "_.break" ent pause "@")
  ent
)

 

And of course it doesn't need to be a Polyline.  But it can't be a Circle or closed/full Ellipse, because those can't be Broken at a single point.

Kent Cooper, AIA
0 Likes
Message 5 of 8

CADIS_DECEMBR2
Explorer
Explorer
Is there any documentation that says that, or it's just noticed in example drawings.
Thanks!
0 Likes
Message 6 of 8

Kent1Cooper
Consultant
Consultant

@CADIS_DECEMBR2 wrote:
Is there any documentation that says that....

Assuming that by "that" you mean the fact that giving Break an entity without pick automatically goes into the First option:

Somewhat indirectly.  Help for the BREAK command says:

"If you select the object by using your pointing device, the program both selects the object and treats the selection point as the first break point."

What it does not say explicitly is kind of implied if you think about it -- that if you don't select it by picking, but by some other means, such as Last or by feeding it an entity name in AutoLisp, it then needs to ask for a first Break point.  You can even select it with Window or Crossing or Fence selection, but only by explicitly calling for such an option [just as you would need to call for Last as an option], not by just picking in space to start a window as with most other selections.  And if the window or fence catches more than one object, it will leave only one [I think the first in drawing order] highlighted and work with only that one, likewise asking for a first point.

 

If by "that" you mean the fact that a Circle or full Ellipse can't be Broken at a single point, that's also sort of implied.  2024 Help's About Breaking and Joining Objects page says:

"To break an object such as a line, arc, or open polyline at a single point without creating a gap, use BREAKATPOINT instead."

[BREAKATPOINT is only in newer versions, but it just builds in "@" for the second point.  There's a Break at Point item in the Modify area of the ribbon in earlier versions, which does the same.]

Note it does not list a Circle, nor an Ellipse or Spline, even though for those you can do it with open ones.  If you try on a closed Ellipse or Spline, you get:  

"Cannot break a closed, periodic curve at only one point."

If you try it on a Circle, you get:
"Arc cannot be full 360 degrees."

Kent Cooper, AIA
Message 7 of 8

CADIS_DECEMBR2
Explorer
Explorer
Thank you Sir,
what I meant by "That" was:
Yes, it depends on the direction. The one that remains under the original entity name will be the one from the original start point up to where you Break it, and the part "downstream" from there will be a new entity name [and (entlast) in AutoLisp, or "Last" if you use that in object selection].

Thanks !
0 Likes
Message 8 of 8

Kent1Cooper
Consultant
Consultant

@CADIS_DECEMBR2 wrote:
.... what I meant by "That" was:  Yes, it depends on the direction. ....

[I guess I should have just asked what you meant -- I was choosing from possibilities in my latest Message before the question, rather than the earlier one.]

I'm not aware of any documentation about the before-the-Break part being the one that keeps the original entity name.  It sort of feels like the logical assumption, and experience bears it out, but I have no more input than that.

Kent Cooper, AIA