Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drawing of a perpendicular between 2 polylines

34 REPLIES 34
Reply
Message 1 of 35
Anonymous
3069 Views, 34 Replies

Drawing of a perpendicular between 2 polylines

Good afternoon. Prompt, please. There is a drawing with set of polylines. How with the help lisp to choose two of them and to construct between them perpendiculars? Thus the first polyline should be broken into identical pieces, and from each these points, since the polyline beginning, perpendiculars on the second polyline will be constructed.
P.S. Polyines can be parallel and not parallel. Edited by: m45bgz on Aug 19, 2009 5:14 AM
34 REPLIES 34
Message 2 of 35
Anonymous
in reply to: Anonymous

Post an example file which demonstrates the results you are looking for.

Joe Burke

wrote in message news:6239418@discussion.autodesk.com...
Good afternoon. Prompt, please. There is a drawing with set of polylines. How with
the help lisp to choose two of them and to construct between them perpendiculars?
Thus the first polyline should be broken into identical pieces, and from each these
points, since the polyline beginning, perpendiculars on the second polyline will be
constructed.
P.S. Polyines can be parallel and not parallel.

Edited by: m45bgz on Aug 19, 2009 5:14 AM
Message 3 of 35
Kent1Cooper
in reply to: Anonymous

Try the attached. It has no error controls, CMDECHO control, localizing of variables, etc., etc., yet.

Depending on the shapes of the Polylines selected, there will sometimes be places where the ends of the perpendiculars will not actually *touch* the second Polyline. If you don't like that result, remove the line that says

"per"

and it will take each Line to the *closest* point on the second Polyline, which in most cases will be perpendicular anyway.

If there's no reason for the Lines to be always perpendicular to the second Polyline, and not [usually] perpendicular to the first one, and to be evenly spaced along the first one but not [usually] along the second one, this could easily be adjusted to divide *both* Polylines into the same number of equal segments, similar to what LADDER.lsp does, here:

http://discussion.autodesk.com/forums/message.jspa?messageID=6110608&tstart=0

but adjusted for Polylines [or any other linear elements, such as Arcs or Splines] instead of only Lines.

--
Kent Cooper


m45bgz wrote...
....the first polyline should be broken into identical pieces, and from each these points, since the polyline beginning, perpendiculars on the second polyline will be constructed.
.... Edited by: Kent1Cooper on Aug 19, 2009 9:30 AM
[added equally-along-both-Polylines topic]
Kent Cooper, AIA
Message 4 of 35
Anonymous
in reply to: Anonymous

Drawing most likely is not necessary. I specify the question. To me it is necessary lisp which would draw slopes with one stroke and with two strokes for choice. Somebody can help me with this point in question?
Message 5 of 35
devitg
in reply to: Anonymous

Next time you need a shoe , ask for it , but do not give your feet size, neither i's color , or sole kind.

Message 6 of 35
Kent1Cooper
in reply to: Anonymous

Does "Drawing most likely is not necessary" mean that you don't think it is necessary to post a drawing showing what you want to do, as Joe Burke suggested? I didn't think it was, for the original question, but that was obviously missing something. If the User should have the choice to "draw slopes with one stroke and with two strokes," then I would need to see what that would look like. Words alone do not give me enough information.

--
Kent Cooper
Kent Cooper, AIA
Message 7 of 35
Anonymous
in reply to: Anonymous

I spread a dwg-file and drawing which should turn out after appendix action. It is a slope with one stroke. I will need in lisp to designate a choice, what slope to draw - with one stroke or with two.
Message 8 of 35
Anonymous
in reply to: Anonymous

A drawing which should turn out after appendix action
Message 9 of 35
Anonymous
in reply to: Anonymous

As a result should the following will turn out:
1. We choose the first polyline
2. We choose the second polyline
3. We enter a step of alternations of lines of slopes
4. We choose a slope kind (with one stroke or with two strokes)
5. Slopes are drawn
Message 10 of 35
Kent1Cooper
in reply to: Anonymous

Too new a version of AutoCAD for me -- can you save it to 2004, or post a .jpg or .tif or .gif or something? Thanks,
--
Kent Cooper
Kent Cooper, AIA
Message 11 of 35
Anonymous
in reply to: Anonymous

Are you asking for LISP help for for a canned LISP program?
I don't do free programs but can tell you that you can accomplish this by
using the vlax-curve functions. To get lines perpendicular to the curve,
get the first derivative at each point, convert that into an angle and add
or subtract pi/2 from that.

wrote in message news:6241086@discussion.autodesk.com...
As a result should the following will turn out:
1. We choose the first polyline
2. We choose the second polyline
3. We enter a step of alternations of lines of slopes
4. We choose a slope kind (with one stroke or with two strokes)
5. Slopes are drawn
Message 12 of 35
Kent1Cooper
in reply to: Anonymous

This is different from your original description. At least I interpreted "...the first polyline should be broken into identical pieces, and from each these points, ... perpendiculars on the second polyline will be constructed" to mean that they are perpendicular TO the second one, not perpendicular FROM the first one, and that is what my earlier routine did. The lines in this image are perpendicular to the *same* Polyline that is divided into equal-length segments, not perpendicular to the *other* one. I think that locating the line endpoints along the outer Polyline in this image would be much more complicated, if this is what you want.

I assume the "two strokes" version would have two half-length strokes in each space between full-length lines. Is that correct?

--
Kent Cooper
Kent Cooper, AIA
Message 13 of 35
Kent1Cooper
in reply to: Anonymous

I'm sure it's just a language thing, but I don't understand number 3. Can you describe that differently, or post an image showing the results of different choices?

--
Kent Cooper


m45bgz wrote...
....
3. We enter a step of alternations of lines of slopes
....
Kent Cooper, AIA
Message 14 of 35
Anonymous
in reply to: Anonymous

I spread an example for numbers 3 and 4. It should turn out as in drawing otkos1.bmp
Message 15 of 35
Anonymous
in reply to: Anonymous

Yes it is correct, is shown in drawing otkosi.bmp
Message 16 of 35
Anonymous
in reply to: Anonymous

I spread a dwg-file in 2004 versions
Message 17 of 35
Anonymous
in reply to: Anonymous

wrote in message news:6241938@discussion.autodesk.com...
I spread an example for numbers 3 and 4. It should turn out as in drawing otkos1.bmp

See if the attached is what you are after, I believe it does what you describe

Regards,

Mel
Message 18 of 35
Anonymous
in reply to: Anonymous

I made a correction.

Regards,

Mel
Message 19 of 35
Anonymous
in reply to: Anonymous

MelFranks, I has tested yours lisp, all is good, that is necessary. But it works only on the closed contour. On the opened contour does not work. I spread the drawing in which this lisp too should work. Check up, please, and if you can, under it make lisp.
Message 20 of 35
Anonymous
in reply to: Anonymous

wrote in message news:6245955@discussion.autodesk.com...
MelFranks, I has tested yours lisp, all is good, that is necessary. But it works only on the closed contour. On the opened
contour does not work. I spread the drawing in which this lisp too should work. Check up, please, and if you can, under it make
lisp.

I cannot open the drawing, I am using AutoCAD 2006.

Regards,

Mel

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report