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

Accoreconsole and c#. how to launch it

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
nice-paca
4207 Views, 4 Replies

Accoreconsole and c#. how to launch it

Hi,

I have a c# launcher for my accoreconsole.Exe. I launch it through the command Process.Start

 

I launch accoreconsole.exe with a script scr to netload a class in c# (same framework 4.0)

 

If I launch the scr from a batch file (trhough cmd.exe, without my c# launcher), the scr is perfect. Runs without error

 

If I launch the scr from my soft in c# (trhough start process), the netload is succees, but I can't launch the command. Accoreconsole doesn't regonize my command.

 

I launch through :

netload d:\test.dll

 

I try with (command ..) Same issue.

 

Have you got any suggestions?

 

Acad : 2013, French and English version. Windows 8.0

4 REPLIES 4
Message 2 of 5
Balaji_Ram
in reply to: nice-paca

Can you please try setting SECURELOAD to 0 in the script, before netload ?

If that does not help, please share a non-confidential sample project to reproduce the issue.

 

Regards,

Balaji

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 5
nice-paca
in reply to: Balaji_Ram

Hi,

 

I use Autocad2013, so I can't use Secureload.

 

To detail more my issue, 

 

I launch Accoreconsole.exe trhough :

 

foreach (string filename in filenames)
{
Process acc = new Process();
const string quote = "\"";
optionsaccoreconsole = quote + pathsprog + "\\" + script;
options = "/i " + filename + " /s d:\\plot.scr";
acc.StartInfo.Arguments = options;
acc.StartInfo.FileName = acccoreconsole;
acc.Start();
}

 

with  string pathsprog = Directory.GetCurrentDirectory();

quote = "\"";

 

My plot.scr is :

 

FILEDIA
0
NETLOAD d:\Plot.dll
plotpdf
FILEDIA
1

 

Thanks for your help

 

Fred

 

Message 4 of 5
Balaji_Ram
in reply to: nice-paca

Hi Fred,

 

Not sure what is missing, but the DevTV sample launches a process similar to the one that you are trying.

http://adndevblog.typepad.com/autocad/2012/04/getting-started-with-accoreconsole.html

 

I gave it a try and it worked ok using AccoreConsole which is part of 2013.

 

Does any other command get recognised ?

A simple SayHello command like this ?

 

[CommandMethod("MyCommands", "SayHello", CommandFlags.Modal)]
public void SayHelloMethod()
{
    DocumentCollection docs = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager;
    Document activeDoc = docs.MdiActiveDocument;
    Editor ed = activeDoc.Editor;

    ed.WriteMessage(string.Format("{0}Hello !!", Environment.NewLine));
}

 and a script which calls it 

 

;Loading the .Net module
(command "_.Netload" "D:\\Temp\\CustomPlugin.dll")
; Run the command
(command "SayHello")

 Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 5
nice-paca
in reply to: Balaji_Ram

Hi,

 

The solution was simple.

 

In debug mode, I can't load a dll in accoreconsole.Exe

 

I need to launch a release version to have the possibility to load one.

 

Thanks for your help

 

 

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