Offset follow

Offset follow

Lukasvop1
Advocate Advocate
3,250 Views
31 Replies
Message 1 of 32

Offset follow

Lukasvop1
Advocate
Advocate

Hi guys, I want to ask if is possible do something like this?

 

This is a common command "Offset" [M]ultiple

Take source Line/PLine and Offset many time, as you want.
But problem is, all distances are measured from source Line/PLine, not last one. In many cases would be more effective measure distance from last created Offset.

Basically, just change offset distance measure type.

Thank you for respond.

 

Offset follow.png

 

0 Likes
Accepted solutions (1)
3,251 Views
31 Replies
Replies (31)
Message 2 of 32

ВeekeeCZ
Consultant
Consultant

It's not. 

 

Offset 2000 <pick> Multiple <pick> <pick> <pick> ... all from the last one. It's not possible to be any different, it would land in the same place over and over again.

0 Likes
Message 3 of 32

Lukasvop1
Advocate
Advocate

I mean :  Offset > Through > pick > Multiple (each offset with different distance..)

0 Likes
Message 4 of 32

ВeekeeCZ
Consultant
Consultant

I see. No fancy stuff can be supported.

0 Likes
Message 5 of 32

Lukasvop1
Advocate
Advocate

@ВeekeeCZ wrote:

I see. But no fancy stuff can be supported.


It's sad..

0 Likes
Message 6 of 32

komondormrex
Mentor
Mentor

fancy comes when command method goes away.

0 Likes
Message 7 of 32

Sea-Haven
Mentor
Mentor

There is so many ways to do multiple offset using a lisp, like keep typing a gap value 10 20 30, type 10,20,30,-10,-20,-30 implies go left and right. 10x4 would be 4 offsets at gap of 10. 

 

So explain a bit more what you want when you refer to "Multiple Offsets".

0 Likes
Message 8 of 32

Lukasvop1
Advocate
Advocate

Surely, lisp which I asking for, allow create multiple offsets, but distance each one is measured from last created offset.

It's very useful, when you've got some reference withou dimensions, and you need create multiple offsets, which distances you don't know.

 

Offset follow example.png

 

1.option is use command Offset and after each one press enter.
2.option is use command Offset, select object, type M, enter - this is exactly I want but problem is all distances are measured from first (source) Line/PLine, so I need calculate each offset in mind.

 

Required lisp should combine both options, work like "2.option" but measure distances betwen offsets like in "1.option".

 

Example:

0 Likes
Message 9 of 32

Sea-Haven
Mentor
Mentor

Try this for 2

(defun c:offfs ( / oldsnap ent off offs pt)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)
(setq off (getreal "\Enter offset "))
(setq offs off)
(setq howmany (getint "\nHow many times to offset "))
(setq ent (car (entsel "\nPick object to offset ")))
(setq pt (getpoint "\nPick a point for side away from object "))
(command "offset" off ent pt "")
(repeat (- howmany 1)
(command "offset" (setq offs (+ offs off)) ent pt "")
)
(setvar 'osmode oldsnap)
(princ)
)
(c:offfs
0 Likes
Message 10 of 32

Lukasvop1
Advocate
Advocate

This don't solve problem. Imagine the situation, you need create offsets with different distances, which value you don't know.

0 Likes
Message 11 of 32

Sea-Haven
Mentor
Mentor

"witch walue you don't know." in the Offset you can pick Trough pt and get 2 points for the distance only issue is must keep repeating Offset, using a lisp could get a base point, then make a list of point selected distances. Then repeat offset as required. You could import your image and use that. Do you know anything about lisp.

 

 

0 Likes
Message 12 of 32

Lukasvop1
Advocate
Advocate

@Sea-Haven wrote:

must keep repeating Offset.


This is whole problem, I want avoid repeating Offset by enter. Repeat it automatically.

 

Is possible this?  (This will work probably only for Line.)

 

1.OFFO (do user)
2.Pick line (do user)
3.Lisp automatically set offset "Through"
4.Lisp automatically toggle ON Dynamic Input
5.Move with cursor and type offset value (do user)
6.Lisp pick line endpoints of last created line
7.Lisp create line between points
8.Lisp select last created line
9.Lisp run command Offset
10.Lisp automatically set offset "Through"
11.Lisp automatically toggle ON Dynamic Input
12.Lisp automatically set offset "Erase" "Yes"
13.Move with cursor and type offset value (do user)
14.Lisp repeat steps 6-13
15.When quit, lisp set offset "Erase" "No"

 

 

0 Likes
Message 13 of 32

Kent1Cooper
Consultant
Consultant

I don't understand the purpose of your steps 6 & 7 and the setting of Offset's Erase option to Yes.  It looks like you want to duplicate the result of the Offset [draw a new Line over it], then Offset that duplicate but Erase it in the process, repeatedly.  Is there some reason not to just Offset, leave the result [i.e. don't draw another over it], and continue Offsetting, without using the Erase option?  If I understand your steps correctly, that would give the same result, and would be far easier to write into a routine.  The one difference is that if the original Line is not on the current Layer, and/or has other property overrides, then in your description the resulting Lines after the first one would be under current settings, but in my suggestion they would all be on the same Layer and with the same properties as the original.  But if you want them on the current Layer, that could be handled with the Layer option in Offset.  Can you clarify?

Kent Cooper, AIA
0 Likes
Message 14 of 32

Lukasvop1
Advocate
Advocate

Only reason was, I didn't know if is possible select last created "Line" by lisp. If it's possible then no need duplicate the "Line".

 

Then steps should looks like this :

 

1.OFFO (do user)
2.Pick line (do user)
3.Lisp automatically set offset "Through"
4.Lisp automatically toggle ON Dynamic Input
5.Move with cursor and type offset value (do user)

 

6.Lisp select last created line
7.Lisp run command Offset
8.Lisp automatically set offset "Through"
9.Lisp automatically toggle ON Dynamic Input

 

10.Move with cursor and type offset value (do user)
11.Lisp repeat steps 6-9

0 Likes
Message 15 of 32

komondormrex
Mentor
Mentor

hey there,

are you looking for something like this?

O.gif

0 Likes
Message 16 of 32

Lukasvop1
Advocate
Advocate

Yes, quite similar. I always would like to see there Dynamic Input. I can measure distance and immediately create offset with right distance 2 in 1.

0 Likes
Message 17 of 32

Kent1Cooper
Consultant
Consultant

I really don't think you want to use the Through option if you're specifying distances.

Kent1Cooper_0-1710853541963.png

The yellow Line is the original, point A is where you pick on it, the radius of the dashed Arc is the specified distance, and the green Line is the intended result.  Unless the cursor direction is exactly perpendicular to the original Line from the pick point, under the Through option the resulting Offset distance will always be shorter than intended.  In this exaggerated example, the cursor direction is significantly off of perpendicular for clarity.  Given that distance at that cursor direction, point B is used for the Through point, meaning the result is the red Line, far less than the intended Offset distance from the yellow original.

 

I think you want it to use the distances you give it, directly, not by way of the Through option.  And this seems to do what I think you may really want, based on the image in Message 1 and some of your descriptions [lightly tested].

(defun C:OMV (/ od esel pt1 pt2); Offset Multiple at Varying distances [same direction]
  (initget 6); no zero, no negative
  (setq
    od (getdist "\nSpecify first offset distance: ")
    esel (entsel "\nSelect initial object to offset: ")
    pt1 (vlax-curve-getStartPoint (car esel))
  )
  (command "_.offset" "_erase" "_no" od (list (car esel) pt1) pause ""); pause for to-which-side
  (setq pt2 (vlax-curve-getStartPoint (entlast)))
  (initget 6)
  (while (setq od (getdist "\nNext Offset distance: "))
    (command "_.offset" od "_non" (list (entlast) pt2) "_non" (polar pt2 (angle pt1 pt2) 1) "")
    (setq pt1 pt2 pt2 (vlax-curve-getStartPoint (entlast)))
    (initget 6)
  )
  (prin1)
)

You specify the initial distance, and pick the original object and the original side for the first Offset only.  Then you simply give it more distances -- no cursor involvement, unless you want to specify a distance by two picks on-screen.  Each distance given is used to Offset the latest result object by that distance in the same direction as you used for the first Offset.

OMV.gif

It works for all sorts of objects [Line, Arc, Circle, Polyline (not 3D), Ellipse, Spline, Ray], with or without Dynamic Input running.  [If you want to be able to use it on Xlines, they don't have a (vlax-curve-getStartPoint), so a check for entity type would be needed, and the MIDpoints used instead.]  In some configurations of Polylines and Splines, when more than one new object results from an Offset, successive Offsets could have odd results, but that's equally true when done manually.  And going inward with Arcs/Circles/Ellipses will run up against a limit, but that's also equally true outside of any routine.

 

If I have misunderstood, explain what should be different.

 

Kent Cooper, AIA
0 Likes
Message 18 of 32

Lukasvop1
Advocate
Advocate

@Kent1Cooper wrote:

I really don't think you want to use the Through option if you're specifying distances.


Yes, this exactly I want and also see there Dynamic Input.
I have only reference (.png) without any dimensions, normally I must measure distances, and after that I can create offsets with right distances.
But when create offset with dynamic input, I can measure distance and immediately create offset with right distance 2 in 1.

0 Likes
Message 19 of 32

Kent1Cooper
Consultant
Consultant

[I don't normally use Dynamic Input, so I wasn't aware of its handling the perpendicular positioning in Offset's Through option.  Later I may consider how to work that into my earlier suggestion.  Or maybe @komondormrex will share what they used to make the video at Message 15 -- I do notice it uses a different command name:  OFFSET_ with the underscore character at the end.]

Kent Cooper, AIA
0 Likes
Message 20 of 32

Sea-Haven
Mentor
Mentor

Very smart answer like it.

0 Likes