Why can't I make a d*mn line??

Why can't I make a d*mn line??

Anonymous
Not applicable
578 Views
2 Replies
Message 1 of 3

Why can't I make a d*mn line??

Anonymous
Not applicable
I'm transferring my VBA code to an independent .Net application. I'm working fine with selection sets, layers, even offsets and copy commands - but for some reason, I get an execution error when I try the AddLine method - can someone tell me what's wrong?

Dim testline As AcadLine
Dim testp1(2) As Double
Dim testp2(2) As Double

testp1(0) = 0 : testp1(1) = 0 : testp1(2) = 0
testp2(0) = 5 : testp2(1) = 5 : testp2(2) = 0

Dim oApp As AcadApplication
Dim oDoc As AcadDocument

oApp = GetActiveObject("AutoCAD.Application")
oDoc = oApp.ActiveDocument
testline = oDoc.ModelSpace.AddLine(testp1, testp2)

That's where I get the "System.ExecutionEngineException" error. Help?
0 Likes
579 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
wrote in message news:[email protected]...
I'm transferring my VBA code to an independent .Net application. I'm
working fine with selection sets, layers, even offsets and copy commands -
but for some reason, I get an execution error when I try the AddLine
method - can someone tell me what's wrong?


Set testline = oDoc.ModelSpace.AddLine(testp1, testp2)

hth
Mark
0 Likes
Message 3 of 3

Anonymous
Not applicable
"MP" wrote in message
news:[email protected]...
wrote in message news:[email protected]...
I'm transferring my VBA code to an independent .Net application. I'm
working fine with selection sets, layers, even offsets and copy commands -
but for some reason, I get an execution error when I try the AddLine
method - can someone tell me what's wrong?


Set testline = oDoc.ModelSpace.AddLine(testp1, testp2)

oops sorry, just realized this is the dotnet grp.
don't know if syntax is different from vb

hth
Mark
0 Likes