Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have used acad electrial and want to get return value after input command in cad command window.
Example is below,
1) Input code is
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
string command = "(c:wd_mdb_get_proj_scratch_dbnam nil) ";
doc.SendStringToExecute(command, false, false, false);

2) return value is "C:\\Users\\xxxxxx\\AppData\\Roaming\\Autodesk\\AutoCAD Electrical 2015\\R20.0\\xxx\\Support\\user\\0003.mdb"

I want a no.2 text. How should I do?

Thanks......

What I have tried:

Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            string command = "(c:wd_mdb_get_proj_scratch_dbnam nil) ";
            doc.SendStringToExecute(command, false, false, false);
Posted
Updated 4-Mar-18 8:30am
Comments
RedDk 3-Mar-18 18:16pm    
Is this command part of some scripting facility in AutoCAD? Anyway, are you trying to administer a "Get" of some sort because I don't actually see a target in that string among the characters ... Typically bigbox apps like those of Autodesk and Wolfram and Matlab, etc have system variables which the interface leverages to skirt calls to windows paths and that "mdb"-containing string looks as if it might be such a variable. Do you think you've spelled everything correctly?

Also, since you've got a system path as your goal, check that directory and verify that the .mdb you seek is actually going to be there when you administer this command successfully.
Member 13671958 3-Mar-18 21:23pm    
Thanks

I use electrical cad and c#, but I think all of cad program is same.
Anyway Cad reply the return value in command window when input any code if code have return value.
So How do I get return value in c#?

Thanks

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900