Jump to content

Draw zig-zag polyline


Luís Augusto

Recommended Posts

Goodnight everyone.

I could use a routine to improve the construction of a polyline in a zig-zag.

Despite being studying AutoLISP'm still not able to perform such a routine. Are limited to insertion and some blocks of conditional attributes.

I know I can build it using the command _.PLINE and accessing the sub commands.

My problem is in the logic set forth the possibilities. I did a survey to know the possibilities and peculiarities of this polilyne.

My need is as follows:

Create a polyline with:

Total length of Polyline known:

Initial and final length known:

Height of zig-zag known:

The variables are as follows:

total_lenght getInt

lenght_ini (initiget 75,100,150); these limit values

lenght_end = Lenght_ini

segments_height (initiget 50 100 150 200 250 300 350 400 450 500), height of the zig-zag

initial_height segments_height = / 2, see the drawing attached

radius getreal

number_segments = ((total_lenght-(2 lenght_ini *)-segments_height) / segments_height)

Explanation: The number of segments is defined as follows.

The total length of the polyline (subtracting the initial length and final length) by subtracting the height of the segments and dividing the height of the segments.

Considering the total length of 500, 100 and the initial height of 100 would thus be:

((500 - (200) -100/100) = 2

Other conditions were shown in the attached drawing.

 

SURVEY.dwg

Calculation of the ZIG-ZAG.xls

 

 

Tale with the help of you.

Thank you. :unsure:

Link to comment
Share on other sites

You probably have too many inputs.

 

If you know the total length, starting and ending segments, then you either need the number of segments or the radius, not both.

 

-David

Link to comment
Share on other sites

You probably have too many inputs.

 

If you know the total length, starting and ending segments, then you either need the number of segments or the radius, not both.

 

-David

 

Hello David. Thanks for answering.

I'm sorry but I can not see it that way.

When I speak length of the polyline, I'm referring to the property of the geometry length. From what I could see, most programs ask the distance between P1 and P2, so I have no control over the length of the geometry.

 

This is the reason to do the subtraction the sides and the beginning of the segment. Only then divide what's left of the last operation for height. That way I'll know how many segments to draw in the middle. Gotta keep the sides independent of height.

As for radius, I'll explain better. Actually this is the spacing in x. This spacing should be twice the radius that will apply thereafter. After finishing the construction of the polyline, the command will use the polyline fillet with half the radius specified above.

Finally you will need an offset to both sides with half the radius. Thus there will be no interference.

 

I ask comprehension of all for my english. Unfortunately not mastered this language and I end up using the translator.

 

I made a little video of 1mb. Surely it would be easier comprehension.

 

https://mega.co.nz/#!WxZ03JrI!GzqG8Rw52t_wMob207XwjH1FYXduycBorxvFdMy7l48

Thank you all.

Link to comment
Share on other sites

Check THIS out .

Hello my friend, how long.

Routines employed there really are wonderful.

The program you wrote caters central part of my polyline, but as said above, need to condition the property lenght to start, end and radius.

I noticed you used the stop polar determine the list of points and then entemake to create a polyline, but still I dare not so much. I know it's simple, but I have to respect how evolution.

Thank you for always being Tharwat helping.

Big hug.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...