Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
This page has been translated for your convenience with an automatic translation service. This is not an official translation and may contain errors and inaccurate translations. Autodesk does not warrant, either expressly or implied, the accuracy, reliability or completeness of the information translated by the machine translation service and will not be liable for damages or losses caused by the trust placed in the translation service.Translate
Hello:
I'm trying to obtain the start & end Points for an offset
line. I'm able to get the points for the original line by
using the StartPoint & EndPoint properties for the line
but due to having to declare the offset line as an object
instead of an array, the StartPoint & EndPoint properties
are not available for use. I'm using Visual Basic 2005 in
Visual Studio 2005. Any help would be appreciated.
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
wrote in message news:5090701@discussion.autodesk.com...
Hello:
I'm trying to obtain the start & end Points for an offset
line. I'm able to get the points for the original line by
using the StartPoint & EndPoint properties for the line
but due to having to declare the offset line as an object
instead of an array, the StartPoint & EndPoint properties
are not available for use. I'm using Visual Basic 2005 in
Visual Studio 2005. Any help would be appreciated.
Tony:
Thanks for your reply but I am still having trouble. I've
included the code that I am having trouble with below.
Any help will still be appreciated.
Dim objLine As Autodesk.AutoCAD.Interop.Common.AcadLine
Dim objOffsetAcadLine As Autodesk.AutoCAD.Interop.Common.AcadLine
Dim dblLineStartPt(0 To 2) As Double
Dim dblLineEndPt(0 To 2) As Double
Dim objOffsetLine As Object
Dim objOffsetDist As Double = 1.0
'
'Initialize Start and End Points
dblLineStartPt(0) = 0
dblLineStartPt(1) = 0
dblLineStartPt(2) = 0
dblLineEndPt(0) = 5
dblLineEndPt(1) = 5
dblLineEndPt(2) = 0
'
'Draw line in modelspace
objLine = acadApp.ActiveDocument.ModelSpace.AddLine(dblLineStartPt, dblLineEndPt)
'
'Offset line by 1.00"
objOffsetLine = (objLine.Offset(objOffsetDist))
'
'Convert Offset Line object to acad Line
objOffsetAcadLine = CType(objOffsetLine, Autodesk.AutoCAD.Interop.Common.AcadLine)
The above code draws the offset line but generates an
error in the last line - "Invalid Cast Exception Unhandled"