.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
Reply
Message 1 of 3
SuperFly
291 Views, 2 Replies

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

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?
2 REPLIES 2
Message 2 of 3
Anonymous
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
Message 3 of 3
Anonymous
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost