offset Lines

offset Lines

Anonymous
Not applicable
283 Views
3 Replies
Message 1 of 4

offset Lines

Anonymous
Not applicable
Two Questions:
Q1.
I want to get the start and End Points of a line that i have offset by
using
offsetObj = oLine.offset(0.25)
I am using :
Dim offsetSP As Variant
Set offsetSP = offsetObj(0).startPoint(0)

But it gives error 451, Can someone tell me please what is the problem with
this one.

Q2:

How can we make multiple offsets to a line as this doesnt work
offsetObj = oline.offset(.25,.5,1)

TYI
irfan
0 Likes
284 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Public Sub offsetTest()
Dim endPoint(0 To 2) As Double
Dim offsetDistance As Double
Dim offsetEntities As Variant
Dim offsetLine As AcadLine
Dim originalLine As AcadLine
Dim startPoint(0 To 2) As Double

startPoint(0) = 0#
startPoint(1) = 0#
startPoint(2) = 0#

endPoint(0) = 10#
endPoint(1) = 0#
endPoint(2) = 0#

Set originalLine = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

offsetDistance = 1#
offsetEntities = originalLine.Offset(offsetDistance)

' Question 1
Set offsetLine = offsetEntities(0)

startPoint(0) = offsetLine.startPoint(0)
startPoint(1) = offsetLine.startPoint(1)
startPoint(2) = offsetLine.startPoint(2)

endPoint(0) = offsetLine.endPoint(0)
endPoint(1) = offsetLine.endPoint(1)
endPoint(2) = offsetLine.endPoint(2)

' Question 2
originalLine.ArrayRectangular 5, 1, 1, 5, 1, 1
End Sub
0 Likes
Message 3 of 4

Anonymous
Not applicable
would this method be compatiable with polylines? here is my situation ... i am drawing a "circle top" style window, consisting of a line and an arc, drawn as a polyline with bulge

i am then offsetting it inside and outside, and i need to draw a line from the place where the arc and line meet on the inside offset TO the place where the arc and the line meet on the outside offset ... here is a portion of the code to assist any suggestions:

THANK YOU VERY MUCH IN ADVANCE!
Public Sub Circle_Top()

Dim arrVertices() As Double
Dim dblWidth As Double
Dim dblFrameOffset As Double
Dim dblFinOffset As Double
Dim dblBulge As Double
Dim dblGlass As Double
Dim dblGlassWidth As Double
Dim dblGlassHeight As Double
Dim dblGlassOffsetWidth3500 As Double
Dim dblGlassOffsetHeight3500 As Double
Dim dim1(0 To 2) As Double
Dim dim2(0 To 2) As Double
Dim dimText(0 To 2) As Double
Dim dblLength As Double

Dim FrameHeight As AcadDimAligned
Dim FrameWidth As AcadDimAligned
Dim FrameRadius As AcadDimRadial
Dim GlassHeight As AcadDimAligned
Dim GlassWidth As AcadDimAligned

Dim varIFrame As Variant
Dim varFin As Variant

Dim objOFrame As AcadPolyline
Dim objGlass As AcadPolyline
Dim objIFrame As AcadPolyline
Dim objFin As AcadPolyline
Dim objCenterPoint As AcadArc
Dim objArc As AcadArc

dblFrameOffset = -2
dblFinOffset = 1.25
dblGlassOffsetWidth = 3.125 ' 3500 series
dblGlassOffsetHeight = 2.75 ' 3500 series

With ThisDrawing.Utility
'Prompt user to enter a width, and assign it to variable dblWidth
dblWidth = .GetReal(vbCr & "Enter your width: ")
End With

dblGlassWidth = (dblWidth - dblGlassOffsetWidth)
dblGlassHeight = ((dblWidth / 2) - dblGlassOffsetHeight)

ReDim arrVertices(8)
'Vertices to draw first polyline
arrVertices(0) = 10: arrVertices(1) = 0: arrVertices(2) = 0
arrVertices(3) = 10 + dblWidth: arrVertices(4) = 0: arrVertices(5) = 0

'Vertices used to draw arc
arrVertices(6) = 10: arrVertices(7) = 0: arrVertices(8) = 0

'Draw line in the model space
Set objOFrame = ThisDrawing.ModelSpace.AddPolyline(arrVertices)

'Create arc from the third set of vertices
objOFrame.Type = acSimplePoly
objOFrame.SetBulge 1, 1
objOFrame.Update

'Draw offsets for Main Frame and Nailing Fin based on variables set within code
varIFrame = objOFrame.Offset(dblFrameOffset)
varFin = objOFrame.Offset(dblFinOffset)
0 Likes
Message 4 of 4

Anonymous
Not applicable
Figured it out ... will use

objFin.Coordinates(0)
objFin.Coordinates(1)

with IFrame Coordinates


Sorry to bother you guys! If you want me to post the entire code I used, let me know :) Message was edited by: RyneMI
0 Likes