.NET

Reply
Active Member
SuperFly
Posts: 6
Registered: ‎08-12-2005
Message 1 of 3 (103 Views)

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

103 Views, 2 Replies
09-16-2005 07:24 AM
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?
*MP
Message 2 of 3 (103 Views)

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

09-24-2005 02:29 AM in reply to: SuperFly
wrote in message news:4958660@discussion.autodesk.com...
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
*MP
Message 3 of 3 (103 Views)

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

09-24-2005 02:32 AM in reply to: SuperFly
"MP" wrote in message
news:4966229@discussion.autodesk.com...
wrote in message news:4958660@discussion.autodesk.com...
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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.