Author Topic: Is that possible to offset only one side of closed pline?  (Read 3755 times)

0 Members and 1 Guest are viewing this topic.

litss

  • Guest
Is that possible to offset only one side of closed pline?
« on: July 05, 2007, 10:36:46 AM »
Is that possible to offset only one side of a closed pline?

My way is: "explode" the pline --> offset the line --> "bo" to creat a new pline to replace the former...

But the problem is, "bo" cannot work every time. Sometimes, there are gaps that cause "bo" failed. At the same time, I can't make the new pline the same properties with the old one.

Would there be some other ways?

LE

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #1 on: July 05, 2007, 11:09:07 AM »
Give a better explanation, what do you mean by one side? and what it is "bo" ?

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Is that possible to offset only one side of closed pline?
« Reply #2 on: July 05, 2007, 11:26:41 AM »
Give a better explanation, what do you mean by one side? and what it is "bo" ?
Yes please do give a better explanation. 

Bo is the boundary command. 

I understand you by offsetting just one side is just offset one leg of the polyline instead of all the legs.  Am I right? 
IF this is the case then there are several ways to do this? 

Now next question are you trying to do it with lisp or just using plain ole core autocad commands?
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

LE

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #3 on: July 05, 2007, 11:38:12 AM »
Give a better explanation, what do you mean by one side? and what it is "bo" ?
Yes please do give a better explanation. 

Bo is the boundary command. 

I understand you by offsetting just one side is just offset one leg of the polyline instead of all the legs.  Am I right? 
IF this is the case then there are several ways to do this? 

Now next question are you trying to do it with lisp or just using plain ole core autocad commands?

Thanks... I see that BO is a short cut for the boundary command - I always used bpoly... anyway.... :)

Note:
A closed polyline can be offset to the outside (area will be greater than the original) and to the inside (area will be less than the original)


Guest

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #4 on: July 05, 2007, 11:57:42 AM »
Is that possible to offset only one side of a closed pline?

My way is: "explode" the pline --> offset the line --> "bo" to creat a new pline to replace the former...

But the problem is, "bo" cannot work every time. Sometimes, there are gaps that cause "bo" failed. At the same time, I can't make the new pline the same properties with the old one.

Would there be some other ways?

What shape is the explode pline?  What side gets offset?

Yes, BO will fail because of the gap created when offset to the outside.  My question is, once you offset the side of the exploded pline, are you extending some lines to the offset lines to create the new shape?

Attached is an image of what I think you're trying to convey.  Is this correct?

LE

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #5 on: July 05, 2007, 12:59:54 PM »
OK since we are in the guess the lisp game, have a look at this quick one.... :)

I know no code is provided, but cannot be too hard to write...

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Is that possible to offset only one side of closed pline?
« Reply #6 on: July 05, 2007, 01:56:25 PM »
Luis, you are just too cool! (and quick, too)

GDF

  • Water Moccasin
  • Posts: 2081
Re: Is that possible to offset only one side of closed pline?
« Reply #7 on: July 05, 2007, 02:08:48 PM »
Luis, you are just too cool! (and quick, too)

Luis

pretty slick.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Adesu

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #8 on: July 05, 2007, 07:42:14 PM »
Hi litss,
yes possible, last time I ever saw that code, I forgot where it put.

Is that possible to offset only one side of a closed pline?

My way is: "explode" the pline --> offset the line --> "bo" to creat a new pline to replace the former...

But the problem is, "bo" cannot work every time. Sometimes, there are gaps that cause "bo" failed. At the same time, I can't make the new pline the same properties with the old one.

Would there be some other ways?

daron

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #9 on: July 05, 2007, 10:49:34 PM »
I was thinking litss was asking about offsetting one segment of a polyline, in which case I believe the vlax-get-curve??? functions should help. You know, the one that returns the nearest points of the segment selected. Then from that take a distance of those two points, information from the user on the distance and side of offset, then just draw a line using polar that parallels the segment the specified distance. It's not a true offset, but it would get the job done. Something quite similar to what LE showed. Sorry, no code here either. I haven't had the time nor inclination to do coding like that in some time. Although, it does seem like fun.

litss

  • Guest
Re: Is that possible to offset only one side of closed pline?
« Reply #10 on: July 06, 2007, 12:11:20 PM »
Thanks all you guys! :)

Sorry for my poor English. Yes, you understanding me right!
"bo" means the command of "boundary".
I do wanna offset one segment of a polyline. The segment might be straight line or curve.
The follwing is my failed code. It can explain my thought, but it is not the one I want.
Looking for some other ways.


Code: [Select]
[color=blue](defun C:FS (/)
  (setvar "osmode" 0)
  (SETQ ENT0 (ENTSEL "\nPick the leg to offset:"))
  (setq pctr (getpoint "\nPick a point inside:"))
  (setq dis (getint "\nDistance to offset:"))
  (SETQ ENT (CAR ENT0))
  (setq ptt0 (cadr ent0))
  (setq e (vlax-ename->vla-object ent))
  (SETQ PTT (vlax-curve-getClosestPointTo E (CADR ENT0)))
  (command "explode" ent "")
  (setq ss1 (ssget ptt))
  (setq ent-o (ssname ss1 0))
  (command "offset" dis ent-o pctr "")
  (COMMAND "-boundary" "a" "o" "p" "" pctr "")
)[/color]

<edit> added code tags  Mav
« Last Edit: July 06, 2007, 12:13:14 PM by Maverick® »