Multiple offset

Multiple offset

agrawalarpitmodi
Explorer Explorer
894 Views
9 Replies
Message 1 of 10

Multiple offset

agrawalarpitmodi
Explorer
Explorer

I want to offset a polyline with multiple distance like offset a polyline length 100 but iwant to offdt 10 left and 12 right for 20 m length and 20 right,  13 left remaining 20 to 40m length and 23 right,  5 left in 40 to 100 m length.  Can anyone help ta  write a lisp thanks

 
0 Likes
895 Views
9 Replies
Replies (9)
Message 2 of 10

Kent1Cooper
Consultant
Consultant

Illustrate, please, including what you start with, the User steps and inputs, and the end result.

Kent Cooper, AIA
0 Likes
Message 3 of 10

Sea-Haven
Mentor
Mentor

Like Kent a real dwg if possible. Before and after.

 

Sounds like 

SeaHaven_0-1657003638408.png

 

0 Likes
Message 4 of 10

agrawalarpitmodi
Explorer
Explorer

dwg like

0 Likes
Message 5 of 10

agrawalarpitmodi
Explorer
Explorer

i want this type of output

0 Likes
Message 6 of 10

narasimharaoarza0211
Enthusiast
Enthusiast

;try once  Arza Narasimharao , narasimharaoarza0211@gmail.com

(defun c:ofset()
(setq ent (entsel "\nSelect a line to which offsets are to be plotted :"))
(setq entname (car ent))
(setq entpickX (caadr ent))
(setq entpickY (cadadr ent))
(setq entlist (entget entname))
(setq xs1 (cadr (assoc 10 entlist)))
(setq ys1 (caddr (assoc 10 entlist)))
(setq xe1 (cadr (assoc 11 entlist)))
(setq ye1 (caddr (assoc 11 entlist)))

(if
(> (abs(- entpickX xs1)) (abs(- entpickX xe1)))
(setq xe xs1 ye ys1 xs xe1 ys ye1)
(setq xs xs1 ys ys1 xe xe1 ye ye1)
)

(setq angr (angle (list xs ys) (list xe ye)))
(setq angd (angtos angr 0 4))


(setq dist (sqrt (+ (expt (- xe xs) 2) (expt (- ye ys) 2))))
(setq ch (getreal "\nSpecify chainage :"))
(setq xch (* ch (cos angr)))
(setq ych (* ch (sin angr)))
(setq ofsetL (getreal "\nSpecify offset distance on Left side of the line:"))
(setq xofsetL (* ofsetL (cos (+ (/ pi 2) angr))))
(setq yofsetL (* ofsetL (sin (+ (/ pi 2) angr))))
(setvar "OSmode" 0)
(setq xL (+ xs xch xofsetL) yL (+ ys ych yofsetL))
(setq ofsetR (getreal "\nSpecify offset distance on Right side of the line :"))
(setq xofsetR (* ofsetR (cos (+ pi (/ pi 2) angr))))
(setq yofsetR (* ofsetR (sin (+ pi (/ pi 2) angr))))
(setq xR (+ xs xch xofsetR) yR (+ ys ych yofsetR))
(setq ch (getreal "\nSpecify chainage :"))

(while (<= ch dist)
(setq xch (* ch (cos angr)))
(setq ych (* ch (sin angr)))
(setq ofsetL (getreal "\nSpecify offset distance on Left side of the line:"))
(setq xofsetL (* ofsetL (cos (+ (/ pi 2) angr))))
(setq yofsetL (* ofsetL (sin (+ (/ pi 2) angr))))
(setvar "OSmode" 0)
(setq xL1 (+ xs xch xofsetL) yL1 (+ ys ych yofsetL))
(setq ofsetR (getreal "\nSpecify offset distance on Right side of the line :"))
(setq xofsetR (* ofsetR (cos (+ pi (/ pi 2) angr))))
(setq yofsetR (* ofsetR (sin (+ pi (/ pi 2) angr))))
(setq xR1 (+ xs xch xofsetR) yR1 (+ ys ych yofsetR))
(command "line" (list xL yL) (list xL1 yL1) "")
(command "line" (list xR yR) (list xR1 yR1) "")
(setq xL xL1 yL yL1)
(setq xR xR1 yR yR1)
(setq ch (getreal "\nSpecify chainage :"))
)
(setvar "OSmode" 685)
(princ)
)

0 Likes
Message 7 of 10

narasimharaoarza0211
Enthusiast
Enthusiast

try with line only not with polyline

Command: LINE
Specify first point:
Specify next point or [Undo]: 200

Specify next point or [Undo]:
Command: AP
APPLOAD ofset.LSP successfully loaded.


Command:
Command:
Command: OFSET

Select a line to which offsets are to be plotted :
Specify chainage :0

Specify offset distance on Left side of the line:20

Specify offset distance on Right side of the line :30

Specify chainage :30

Specify offset distance on Left side of the line:40

Specify offset distance on Right side of the line :50
line Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:
Command: line Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:
Command:
Specify chainage :75

Specify offset distance on Left side of the line:50

Specify offset distance on Right side of the line :20
line Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:
Command: line Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:
Command:
Specify chainage :150

Specify offset distance on Left side of the line:20

Specify offset distance on Right side of the line :30

0 Likes
Message 8 of 10

agrawalarpitmodi
Explorer
Explorer

I want to multiple offset in polyline in diffrent distance

Message 9 of 10

Kent1Cooper
Consultant
Consultant

The extraordinarily difficult part about that is what needs to happen along the offset results where a change in the central Polyline path direction occurs.  With bends between line segments [as it looks like in your image], the location of a vertex in a result Polyline will be short of the vertex in the central path if the Polyline bends toward the side of the result, or beyond it if it bends away, and how far short or beyond will be a function of a combination of the offset distance and the angle of the change in direction, with some trigonometry involved.  So a routine would always need to be looking ahead to the Polyline segment beyond the one it is trying to draw parallel to at the time.

 

And questions arise:  Would the path Polylines ever involve any arc segments?  If so, would they always and only have tangent transitions at their ends, whether joining line or other arc segments?  [If they would always be tangent transitions, and if there would never be corner bends with line segments on both sides, the great difficulty described above would be removed, but the arc segments themselves make for line-vs.-arc-mode complications for the result Polylines.]

Kent Cooper, AIA
0 Likes
Message 10 of 10

Sea-Haven
Mentor
Mentor

Need to do a offset then trim to vertical ends maybe use Fillet. Joining segments as you go. Like Kent not a easy task.

 

SeaHaven_0-1657070095333.png