New to .net programming and running into an issue. Trying to create a simple command to fire my Civil 3D desktop shortcut. This line works on any shortcut (.lnk file) except AutoCAD shortcuts.
Process.Start("C:\shortcuts\AutoCAD Civil 3d 2012 Imperial.lnk")
I receive the error:
Win32Exception was unhandled
The system cannot find the file specified
Which doesn't make a lot of sense to me since it will run any shortcut in that folder, and yes that is the name of the Civil 3D shortcut. Start>Run fires the shortcut just fine.
What is it not finding? Is there an issue with the Target or the Start In: properties in the shortcut file? It has the default icon properties from the install.
I have tried several solutions offered online none of which work (shell or shellexecute). The problem doesn't appear to be simply firing a .lnk file since all others work.
Thanks for any advice.
Maybe:
Process.Start("C:\\shortcuts\\AutoCAD Civil 3d 2012 Imperial.lnk")
or:
Process.Start(@"C:\shortcuts\AutoCAD Civil 3d 2012 Imperial.lnk")
?
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Thanks for the suggestion but no luck.
I almost have it but when I use the code below the software fires, but I get a dialog pop up that says "Cannot find the specified drawing file. Please verify that the file exists." I can OK it and move on but I have no idea what is causing that.
System.Diagnostics.Process.Start("C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\acad.exe", arguments:=("/ld C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\AecBase.dbx""/p C:\Profile Folder\C3D201264.arg"))
It look like C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\AecBase.dbx have to be in double-quote because this line has spaces.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Looks like that may have did it. Will let you know for sure. Thanks!
What I am trying to do is just a simple form to fire AutoCAD using various profiles - looks like I might be able to get rid of the aecbase.dbx load anyway - just copied it from the default icon.
The first step is to set WorkingDirectory. In this case, no necessary to set the full path to aecbase.dbx
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn