Replace long line with Several different length lines?

Replace long line with Several different length lines?

Anonymous
Not applicable
321 Views
4 Replies
Message 1 of 5

Replace long line with Several different length lines?

Anonymous
Not applicable
Let's say I have a pline 17'-3". I want to replace it with (2) 8' plines and (1) 1'-3" pline. I can then get my start and end point to insert my blocks. I'm just not sure how to program in the new lines and delete the original line. Any help would be appreciated.
Thanks
Wayne
0 Likes
322 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Well I thought I would ask, anyway.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Do you really want 3 lines or just the points along the line to insert a
block there?

First select the line:
ThisDrawing.Utility.GetEntity oEnt, vPick, "Select line: "

Then make sure a line was selected:
If TypeOf oEnt is AcadLine Then
Dim oLine as AcadLine
Set oLine = oEnt
vStart = oLine.StartPoint
dAng = oLine.Angle
pt1 = ThisDrawing.Utility.PolarPoint(vStart, dAng, 8.0)
pt2 = ThisDrawing.Utility.PolarPoint(pt1, dAng, 8.0)
vEnd = oLine.EndPoint
End if

This gives you the 4 points required to either create new lines (AddLine) or
use as insertion points for (InsertBlock).....
To delete the original line: oLine.Delete

HTH

wrote in message news:5419240@discussion.autodesk.com...
Let's say I have a pline 17'-3". I want to replace it with (2) 8' plines and
(1) 1'-3" pline. I can then get my start and end point to insert my blocks.
I'm just not sure how to program in the new lines and delete the original
line. Any help would be appreciated.
Thanks
Wayne
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi Wayne,

Patience is a virtue, particularly when your question give no indication of
your skill level to deal with the answers you get and you post in the middle
of the night.

The general concept you need is to create a method of inputting the data you
want to deal with:
ie,
the starting polyline
which end of the polyline to start the measurement from
the length of the repeating segments
the name of the block you wish to insert (will it be in the drawing, or an
external file?)
the 3 scale factors on the block
the rotation on the block
the layer, linetype, lineweight etc of the lines you draw if they are to
specific - or you could get them from the polyline

Next you do the calculations and draw the new lines
ie
Get the start point of the polyline
Next you get the length of the polyline and the direction towards the far
end
Calculate the location of the end of the first line
Draw the line and a block at the start of the line
Subtract the length of the drawn line from the length of the polyline to
create a remainder value
Loop repeating the above subtracting the drawn length from the remainder
value till the remainder length is less than the length of your repeating
segment
Draw the last shorter line and blocks at its start and end

Delete the polyline

Offer the user the opportunity to repeat with or with out without changed
settings

The first part can be readily done in a form and the rest in a function call
from the form
--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com

wrote in message news:5419240@discussion.autodesk.com...
Let's say I have a pline 17'-3". I want to replace it with (2) 8' plines and
(1) 1'-3" pline. I can then get my start and end point to insert my blocks.
I'm just not sure how to program in the new lines and delete the original
line. Any help would be appreciated.
Thanks
Wayne
0 Likes
Message 5 of 5

Anonymous
Not applicable
Middle of the night? I posted at about 1:30 pm EST. Anyway I appologize for seeming impatient. I will take your and Jeff's suggestions to work on monday and see where they lead. Thanks again all.
0 Likes