Jump to content

.NET Code Runs Fine with AC2013 but Not 2015 Mech


Bill Tillman

Recommended Posts

Okay, here's the deal. I was running a machine yesterday which had AutoCAD 2013. I was also using a C# program in Visual Studio Express which gathered some data, launched AutoCAD 2013, loaded and executed a LISP file which prepared and saved a drawing. Everything worked fine.

 

Last night they updated my system to a new, faster machine which has AutoCAD 2015 Mechanical. I'm using the same Visual Studio C# code and the same LISP code. The process starts, AutoCAD opens and starts the drawing but then it pauses. I can see where it pauses and I checked the LISP code for any anomalies but nothing seems to be there. So I loaded the LISP code on the 2015 machine with the LISP IDE opened and ran it from the AutoCAD command line and it worked fine. This thing only pauses when I'm running it from the C# code using AutoCAD 2015.

 

The pause which happens can be continued if I focus Windows on the AutoCAD window and click the mouse or press enter. But this only happens on the 2015 machine. This pause does not happen on the 2013 machine, using the exact same code. And yes, I swapped out the 2015 COM reference in VS for the 2013 COM reference when I switch between machines.

 

I know exactly where the code is pausing and it's between two dimlinear commands:

(command "._DIMLINEAR" (polar (polar pt1 pi 4) a90 2) (polar (polar pt2 0 4) a90 2) (polar pt1 a90 24) "")
(command "._DIMLINEAR" (polar (polar pt1 pi 2) a90 4) (polar (polar pt4 pi 2) a270 4) (polar pt1 pi 24) "")

The first dimlinear command executes and then that's where it pauses in 2015. The second command does not execute unless I interact with it. And as most of you know, I'm working on strictly automated programs which cannot depend on any user input, of any kind.

Link to comment
Share on other sites

Thanks. That took care of that command....but it paused right again after that. Is this "-s" something unique to AutoCAD 2015, or Mechanical.... and if so, should I change all the "command" to "command-s"? That's no problem but at least some of the command without the -s is working.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...